[SOLVED] Having troubles turning off animation

Almakos

  • Posts: 632
Hey guys,
I have unchecked "looping?" in the appearance tab, and when animation finishes, actor stays with the last frame of the animation. Now I want to check whether animation is playing, and the result is "yes" all the time...So how do I kill it? or should I count frames to do that?
Thanks

« Last Edit: June 12, 2012, 12:56:09 pm by Almakos »
Fishing Fantasy Trailer


rob1221

  • *
  • Posts: 9472
You should probably swap the condition with the time block.

Do every 1 sec
---If animation is playing
------print yes

Almakos

  • Posts: 632
That is true, stupid way to check things :)
...but I still cannot catch when animation is not playing =(
Fishing Fantasy Trailer


hansbe

  • Posts: 262
Check if the current frame equals the total number of frames.

edit: that might be (total number of frames - 1) if current frame is zero based. which it probably is.

Almakos

  • Posts: 632
Check if the current frame equals the total number of frames.

edit: that might be (total number of frames - 1) if current frame is zero based. which it probably is.
I am putting current frame check in the wrong place (as nothing is printed to the console) and haven't figured out where it should go =)
Fishing Fantasy Trailer


hansbe

  • Posts: 262
How about putting all the code from "Set Last Frame to ..." into a when updating behavior or event for the explosion actor?
Also, you should recycle it not kill it at the end, since you used create recycled.

Almakos

  • Posts: 632
ok, done =)
Awesome, thanks.
Fishing Fantasy Trailer