How to get rid of random spawned actor when new random actor is spawned

creationdesigncreationdesign Member Posts: 3
edited August 2014 in Working with GS (Mac)

I have a timer set to change an attribute Sides to random(1,2) every 10 seconds. I'm just testing it right now, normally it'll have random(1,24) and have random timer seconds as well. Then I have 2 other actors that have rules that say when attribute Sides = 1, spawn these 4 actors. And then if attribute Sides = 2, spawn these different 4 actors. It works, and my different actors spawn every 10 seconds. Here's the problem. The old actors stay, and stay and stay, so they build up. I've tried destroying them, I've tried even setting the alpha to 0, but they just won't go away. Any ideas? Is there a rule that I can use specifically? I thought maybe a rule that says when attribute Sides doesn't = 1, then destroy, or set alpha to 0. But that doesn't work either. I'm sure it's something very simple that I'm missing. Thanks!

Comments

  • AlkaPPAlkaPP Member, PRO Posts: 194

    put a timer into your actor after 10 seconds then destroy self. Or any seconds that you want the old actors to be destroyed.

    My Gamesalad Games On App Store:

    Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1

  • creationdesigncreationdesign Member Posts: 3

    I could do that, except for I actually want the spawned actors to spawned randomly, not every 10 seconds. 10 seconds was only just to test at the beginning... So they need to be spawned every random seconds. Is there a way to link the destroy self behavior to when the next actor is spawned? That way it doesn't happen at a specific time, but at an event?

  • AlkaPPAlkaPP Member, PRO Posts: 194

    you want to destroy the old actor before the next actor spawn or after?

    My Gamesalad Games On App Store:

    Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1

  • creationdesigncreationdesign Member Posts: 3

    Basically it needs to be destroyed when the new actor spawns because the new actor replaces the old actor.

Sign In or Register to comment.