Destroy animation after playing once. Please Help!!!

KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
edited February 2012 in Working with GS (Mac)
Hello all,
When the player actor's Y reaches, say 170, I am spawning an actor which is an animation. I would like the animation to be destroyed after it has played through once. How should I go about this? Thanks in advance!

Thanks,
killerpenguins

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Use a timer
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Should I create a game attribute to go with the timer? Trying different ways but no luck yet. Thanks again
  • aarioaario Member, PRO Posts: 256
    divide the number of frames in your animation by the fps you chose then put that number in the timer.

    so [AFTER x seconds] --> DESTROY
  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    Thanks a bunch!!! Works great! Can't thank you enough!!!

    Thanks,
    killerpenguins
  • MotherHooseMotherHoose Member Posts: 2,456
    if your animation is a sequence of non-repeating images:

    just add a rule right after the animationBehavior's box:
    Rule: when
    Attribute: self.image = nameOfLastImage.png
    --Destroy (if you want a delay in this … enclose in an Timer: After: 0.1 seconds)

    @};- MH
Sign In or Register to comment.