How do I ...advance one frame of animation per click?

  • Hello all.

    I have a strip animation that is 10 frames long. I want to click on a button and the animation advance to the next frame. So it would look like this:

    Click 1 = Shows Frame 1

    Click 2 = Shows Frame 2

    Click 3 = Shows Frame 3

    Click 4 = Shows Frame 4

    ...etc

    I can click my button and the animation plays but but the WHOLE animation plays each time.

    Any ideas?

    Thanks so much.

  • Have you disabled the animation in the "sprite editor"?

  • set animation speed to 0

  • Hi all,

    Setting the animation to '0' appears to stop the animation altogether. Any other value just slows or speeds the animation. It doesn't actually stop at a frame. Also, I don't see in the editor where I disable the animation.

    Thanks anyways.

  • Hello,

    Set the animation speed to 0, then go into your events and go on the "On click" event and make an event for the Sprite that has these frames, and choose "Set animation frame" and when it asks you to enter a value for the frame, you will want to type in "Self.AnimationFrame+1".

    That's about it

    When it reaches its final frame (10th frame) and you click again, I think it will remain on the 10th frame. But yeah, hope this helps.

  • JLH1964

    I have attached a screen shot of settings / code that will work (1 line of code and example of what your animations should be set on.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • JLH1964

    I have attached a screen shot of settings / code that will work (1 line of code and example of what your animations should be set on.

    That did it Thank you so much for the help.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)