Help with spawns.
anthonymtara
Member Posts: 4
How do I make it so the spawn I created deletes the previous random actor every time it spawns a new random actor?
Comments
Create an integer attribute called game.spawnCount with the starting value zero. In the spawned actor, create an integer attribute called self.myCount with the starting value zero.
In the spawner actor:
[Rule to spawn a new actor]
Change Attribute game.spawnCount to game.spawnCount + 1
Spawn Actor
In the spawned actor:
Change Attribute self.myCount to game.spawnCount
If attribute game.spawnCount > self.MyCount
Destroy Actor
Or, an easier way is to have the spawned actor spawn a new actor and then destroy itself.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks