Destroy all Instances of Actor

bkhoward2001bkhoward2001 Member, PRO Posts: 86
edited March 2018 in Working with GS (PC)

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

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    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.

  • bkhoward2001bkhoward2001 Member, PRO Posts: 86

    Thanks I will try that!

Sign In or Register to comment.