I Wanna Community

How can I make a sprite's animation not loop (only play once and then stop)?

0 Members and 1 Guest are viewing this topic.

Offline PlasmaKaboom

  • 15
  • OS:
  • Unknown Unknown
  • Browser:
  • Chrome 57.0.2987.146 Chrome 57.0.2987.146
  • Playstyle: Keyboard
Is there an easy way to tell an object not to loop it's sprite animation? When I restart a room I want an animation of one of my sprites to only play once and then stop, only repeating when I restart the room again.

Offline WetWookie

  • 90
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Firefox 52.0 Firefox 52.0
  • Playstyle: Keyboard
There's an animation end event. I think you can just set the image_speed to 0 in it.

Offline PlasmaKaboom

  • 15
  • OS:
  • Unknown Unknown
  • Browser:
  • Chrome 57.0.2987.146 Chrome 57.0.2987.146
  • Playstyle: Keyboard
I should have been more specific. The suggestion I was just given does make the sprite animation play just once, however it disappears once it's done. I need it to pause after it plays once (meaning I need it to freeze in place on the sprites last animation frame). Is there a way to do that?

Offline Denferok

  • Administrator
  • 354
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Chrome 57.0.2987.133 Chrome 57.0.2987.133
    • My stream
  • Playstyle: Keyboard
Put this into the animation end event and it should work
image_index = the last image number of your sprite's animation
image_speed = 0

Offline PlasmaKaboom

  • 15
  • OS:
  • Unknown Unknown
  • Browser:
  • Chrome 57.0.2987.146 Chrome 57.0.2987.146
  • Playstyle: Keyboard
Oh my gosh thank you! That's exactly what I was looking for!