How to test if Sprite is on a xxx animation but not playing?

Discussion and feedback on Construct 2

Post » Sun May 24, 2015 11:33 am

I understand there is a way to find out whether a sprite is playing animation "xxx" but one can later issue a "stop" command to stop it at its frame whatever it is in the animation that it is currently playing it.

Now...

Is there a way to later fine out if it is currently not playing ?

Yes again I understand there is a way to find out whether it is playing a certain animation, but is there a way to find out if it is not playing when it is in that animation ?
B
12
S
3
Posts: 288
Reputation: 1,694

Post » Sun May 24, 2015 12:14 pm

Well, it looks like... action... the sprite in question... under animations "is playing" then it asks you which animation to test (It's "Default" if you haven't named it anything).

Wait, what is your question? How to test if it's not doing what it says it's doing?

Oh do you mean to invert the condition? Right click on the condition and select "invert". Is that it?
B
13
S
5
G
4
Posts: 139
Reputation: 2,586

Post » Sun May 24, 2015 2:14 pm

This depends on what you mean by testing if an animation is "playing" or "not playing". An animation can be playing with an AnimationSpeed of 0 (set to zero or stopped using events).... Either way, if an image is displayed then an animation is playing. So, I think you're asking how to check if the frame rate for an animation is above zero. In which case, use something like:

System : Compare Two Values [Sprite.AnimationSpeed > 0]

To test if the sprite is on xxx animation:

System : Compare Two Values [Sprite.AnimationName = "xxx"]
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,285
Reputation: 47,554

Post » Sun May 24, 2015 3:03 pm

Oh that's a great idea. :)
B
13
S
5
G
4
Posts: 139
Reputation: 2,586

Post » Mon May 25, 2015 2:38 pm

YES AnimationSpeed !
Thank you Awesome Colludium!
B
12
S
3
Posts: 288
Reputation: 1,694


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 2 guests