I have another problem: I wanna...
- ... create an object
- ... set the object's instance variables before OnCreate is called
- ... check within OnCreate the value of the instance variable
My problem with that is, that OnCreate is called immediately after I create the object. But I want to change the instance variables of the created object first before OnCreate is executed
Here's an example:
I have an enemy spawner. The spawner has 2 different modes
- Spawn the enemies behind a door and set the "invading" boolean to true. In OnCreate of the enemy check if "invading" is true and let the enemy run into the room
- Distribute the enemies in the room (they're standing still when created). "Invading" is left false
How can I access the instance variable before the "OnCreate"-event is called?