stop behavior if killed?

readerboy7

  • Posts: 59
i have a series of behaviors. one scene behavior creates object a every 0.6 seconds. my actor behavior switches the scene  if the object is not destroyed within 5 seconds (theoretically). however, the scene switches after 5 seconds even when the actor died. can you help?
here is the actor behavior:
when created
do after 5 seconds
if self is alive
fade out

always
if mouse was pressed on self
incriment attriburte by 1
kill self


scene behavior:
when created
do every 0.6 seconds
create objects at x: random int between 0 and scene width, y: random int between 0 and scene height.

can someone please help?

Miasmos Games

  • Posts: 878
Firstly, next time please post pictures, they're much easier to understand than writing it out. Are you using recycled actors? That would be my one thought on this subject as there have been issues with recycled actors not dying properly.

Cupcake Bounce

readerboy7

  • Posts: 59
the trolls are created every 0.6 seconds
couldn't figure out how to put the picture here so i have to provide you with a direct link.
http://s1252.photobucket.com/albums/hh564/readerboy7/?action=view&current=trollact.png

« Last Edit: April 06, 2012, 11:46:09 am by readerboy7 »

Ryusui

  • Posts: 827
See "Attachments and other options" beneath the message box? Click that. That'll allow you to simply attach a picture to your post.

Anyway, if "kill [Self]" and "if [Self] is alive" aren't working for you, why not set and check a boolean attribute? Create one in the attributes tab, set it to false by default, switch it to true when killed, and check whether it's true or not after five seconds.
In the event of a firestorm, the salad bar will remain open.