Create Object by Object Variable? (solved)

solution: Create Object by Object Variable? (solved) - #3 by MrMen

I Have a Group of Enemy Objects. Is there a way to create Enemy Instances dynamically without them being in the Scene?

Condition:
EnemyGroup.Variable(Name) = Enemy1
Action:
Create Object “EnemyGroup”

This one should now create the Enemy1 Object but since there is none in the scene, the Condition is false. A Workaround I use is set up for each Enemy Object a separate Create Action, having hundreds of different Enemy Object with Different AI makes it very taxing to maintain the code.

Is there maybe a way to Bound a Variable to an Object in general so it does not have to be in the Scene to be true?

Why don’t you use scene or global variables instead?

Use the action “Create objects from its name”, it should do the job.

No, you can’t access object variables of objects that doesn’t exist.

1 Like

Yes, though they need to be in an object group first. Click on Add action and start typing in “Create”. In the list, there should be “Create an object from its name”. The parameters are the group name, object name and x & y co-ordinates.

1 Like

damn i’ve never seen this, thank you so much for your time!