Array of Objects

Is there a way to create an array of objects? I have a system to spawn enemies at set locations, but as of now it only spawns one type of enemy. I had an idea to create an array of enemy objects so that I can call a random one of them in my spawning system, but I’m not aware of any way to create such a thing. If anyone can help, then it would be greatly appreciated. Thank you for reading.

Short answer: No.

Long Answer: No, but you could probably get close by putting all of the objects into an object group, then using the “Create an object from it’s name” action.

This will allow you to either by having your objects named all similarly + a number (Enemy0, Enemy1, Enemy2, etc) and then call the name “Enemy” + ToString(Random(2)), or by having a separate array of names and calling ToString(YourArray[ToString(Random(2))]) or something similar.

5 Likes