Destroy all Instances of Actor
bkhoward2001
Member, PRO Posts: 86
I have a game that is spitting out a ball (instance) every few seconds, so there could be 10 plus on the screen at a single time. When a ball hits my actor, I need to destroy all the ball instances on the screen so it will just keep spitting out new balls. This will give the actor a fresh start after respawning.... So my question is: How do I do a destroy command that removes all the instances of the actor on screen?
Note: I attempted to do a scene reset but that resets all my actors not just the balls....
Comments
I would create an Attribute called "KillBalls" and set this to True when all the balls should be destroyed. Then in the ball actor check the value of KillBalls, when it's true run the destroy behavior. Of course make sure and set the value back to False after all balls have been destroyed.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thanks I will try that!