On animation finished & set animation & stop

Bugs will be moved here once resolved.

Post » Tue Feb 10, 2015 3:18 pm

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
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 8
Reputation: 216

Post » Wed Feb 11, 2015 8:32 am

Better logic

Image
Image
B
25
S
9
G
2
Posts: 139
Reputation: 3,024

Post » Wed Feb 11, 2015 9:22 am

Thanks, that works!

But why "stop" method does exist if this logic is better?
B
4
Posts: 8
Reputation: 216

Post » Wed Feb 11, 2015 1:51 pm

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
Image
B
25
S
9
G
2
Posts: 139
Reputation: 3,024

Post » Wed Feb 11, 2015 2:26 pm

Ok, I see how to use it

Fidasx wrote: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.
B
4
Posts: 8
Reputation: 216

Post » Wed Feb 11, 2015 3:08 pm

StopAnimation.png

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.
StopAnim2.png
You do not have the required permissions to view the files attached to this post.
B
22
S
4
G
2
Posts: 362
Reputation: 2,355

Post » Wed Feb 11, 2015 3:49 pm

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

Screenshot at 16-44-03.jpg


[edit] i made an error in my screenshot, the event condition must be animation1 ;)
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 8
Reputation: 216

Post » Mon Feb 16, 2015 4:19 pm

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.
Scirra Founder
B
373
S
218
G
84
Posts: 23,444
Reputation: 186,078

Post » Mon Feb 16, 2015 4:48 pm

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.

Ashley wrote: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... :|
B
4
Posts: 8
Reputation: 216


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests