Play animation in reverse

Get help using Construct 2

Post » Mon Feb 06, 2012 4:54 am

Hello,

How to play animation in reverse? I know that I can duplicate an object and to set all frames in different order. Just want to know is there any function to do it with some action or event.

Thank you!
B
7
Posts: 36
Reputation: 628

Post » Mon Feb 06, 2012 5:05 am

Set loop off and set frame progression on a variable.

There's probably an easier way.
B
11
S
3
G
2
Posts: 110
Reputation: 2,410

Post » Mon Feb 06, 2012 11:58 am

Reading the guts of the Sprite plugin, It's possible.
Maybe it's a Ash forgot to check that, but if you put a negative number into the speed property values you'll have a buggy animation.
However if you set the animation speed by event to a negative value, the animation will be read backward.
Unfortunately the loop value won't be taken into account and you'll have to 'manually' set the starting frame. In event and/or in properties.

In short,
[code]+System: On start of layout
-> Sprite: set animation to self.AnimationFrameCount-1
-> Sprite: set animation speed to -5
+Sprite: Animation Frame = 0
-> Sprite: set animation to self.AnimationFrameCount-1[/code]
Works.
But note that the 0 frame will never be seen, so you should put a blank frame for first frame.Yann2012-02-06 11:59:33
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Wed May 15, 2013 4:57 pm

Another event workaround:

Compare if animation is on frame 0, then go to last frame of animation.
B
19
S
3
G
2
Posts: 212
Reputation: 4,011

Post » Wed May 15, 2013 5:07 pm

Why don't you just flip the animation around in Photoshop and then reload the frames. Might not be the best way for file size. But if its just for one or two animations, then it is definitely the easiest.
B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Post » Sat May 24, 2014 9:02 pm

Hi folks, I was doing a search on this topic and came across this thread. Setting my animation speed to a negative number worked for me-

*I had an animation run to the last frame and loop was set to "no", speed set to 10

*When I wanted animation to reverse i set speed to -10, and "start animation from current frame" (in this case, my last animation frame).

This worked great for getting some acting out of characters that "start" and "stop" (in this case talking, looking up, or down etc.), but I don't know if it would be ideal for looping animations.
B
6
G
1
Posts: 15
Reputation: 615

Post » Tue May 05, 2015 2:50 pm

i need to play a looping animation backwards or forward (toggle looping backwards/forward direction with two button) how can i do this? there is a trick to reverse looping animation without insert a blank 0 frame? (this because in forward direction the blank frame is visible and make the animation wrong ... and i can't duplicate frame for memory reason).. thanks in advance!


solved by myself thanks :)
B
21
S
2
G
4
Posts: 30
Reputation: 3,549

Post » Tue May 05, 2015 9:36 pm

Yann wrote:But note that the 0 frame will never be seen, so you should put a blank frame for first frame.Yann2012-02-06 11:59:33


To avoid the 0 frame not see simply wait 1/animation speed seconds, so no need to put a blank frame for first!

In short,
Code: Select all
+System: On start of layout
  -> Sprite: set animation frame to self.AnimationFrameCount-1
  -> Sprite: set animation speed to -5
+Sprite: Animation Frame = 0
  -> System: Wait 1/5 seconds
  -> Sprite: set animation frame to self.AnimationFrameCount-1

Works perfect! ;)
thanks!
Aelfraed
B
21
S
2
G
4
Posts: 30
Reputation: 3,549

Post » Mon Feb 29, 2016 3:55 am

hi guy´s check this error

"play current animation to.."

"to keyframe"

"4"

in my case, my char was playing the animation in reverse. try to put hight values
B
5
Posts: 2
Reputation: 239


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, Braus and 2 guests