Problem with spawned actor
DesB
Member Posts: 39
Hi there
I want to destroy a spawned actor after (say) 5 seconds....how do I do this?
Thanks
I want to destroy a spawned actor after (say) 5 seconds....how do I do this?
Thanks
Comments
So, say for example – a bit different from what you require – you wanted a spawned actor to be destroyed when it collides with another actor, you'd have a scene attribute in the second actor which says: Rule when collide or overlap with game.SpawnedActor then set scene.background.Hit to true.
Then in the actor's prototype that's going to be spawned, put when scene.background.Hit is true then Destroy this actor.
So back to your original question, the solution is even more straightforward, put a Timer, after 5 seconds then a Destroy Behavior. So every time it's spawned it'll destroy itself after that set time.
Hope that helps you. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps