On animation finished & set animation & stop

0 favourites
  • 9 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Problem Description

    Hi,

    I think i found a bug.

    When we set an "on animation finished" condition, it is triggered.

    In actions, when we set a new animation for the sprite, it is set.

    but if we want to stop it, it doesn't stop.

    Thanks

    Steps to Reproduce Bug

    Just launch the capx

    Observed Result

    the animation2 doesn't stop at frame 2

    Expected Result

    the animation2 must stop at frame 2

    Affected Browsers

    • Chrome: YES
    • FireFox: YES
    • Internet Explorer: doesn't support html5...

    Operating System and Service Pack

    Win 7 Pro SP1 64 bits

    Construct 2 Version ID

    Release 195 (64-bit)

    Build at 15:36:00 on Jan 19 2015

  • Try Construct 3

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

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

  • Thanks, that works!

    But why "stop" method does exist if this logic is better?

  • stop animation is used as a action when you need to check if an existing animation runs so you stop it (at least most of the times is used like that)

    like

    Animation is playing "running" - action> stop animation

    player is not moving

    it stops any currently playing animation but it does not set a specific frame when it stops

  • Ok, I see how to use it

    it stops any currently playing animation but it does not set a specific frame when it stops

    Not really true if you look at my capx.

    The "stop" method doesn't work in this case.

    Otherwise, thanks for your replies. I applied modifications to my project by your way.

  • [attachment=1:3ikgczdq][/attachment:3ikgczdq]

    It would be best this way because depending on what you are planning to do with your project with what was suggested would keep getting run every tick and just keep setting the frame back to 2 instead of setting it to two and then stopping it. So the event will only execute when needed instead of every tick. I mean if it is sitting on frame 2 might as well stop it an not use unnecessary processing. When you ready for it to run fully start it back up. But the stop does work. Well in 196.2 it does.

    Actually you don't need the stop in the first area cause you switching the animation anyway.

    [attachment=0:3ikgczdq][/attachment:3ikgczdq]

  • A good way to don't have this problem would be to have a "stop" option in the "set animation" action.

    [attachment=0:1yf5ws5p][/attachment:1yf5ws5p]

    [edit] i made an error in my screenshot, the event condition must be animation1

  • Closing as won't fix: I don't see why you would want to set an animation and stop it immediately afterwards in an "on animation finished" trigger. Since the actions don't seem to make sense I'm not going to investigate this. It appears there are good alternatives already proposed here.

  • I used an animation to store playing cards.

    I set the frame to choose 1 of the 52 cards.

    my sprite "card" plays the animation "rotating" of the card rotating and changing perspective and with a tween to come on the screen. On finished it plays the animation "show" which turns the card. On finished it plays the animation "cards", stop it, and set the frame to the card i want to show.

    Since the actions don't seem to make sense I'm not going to investigate this.

    Since the animation doesn't stop while its name is "stop animation", personally i'd have investigate on it...

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