Resume animation where it stopped, is there a way to keep track of this
So I have a 12 image animation I am working with, this is the ground. I am making an endless runner, so when the player is running the ground will run through the animation. I give the player the ability to "stop" so I stop the ground animations and I leave "Restore actor image' UNCHECKED. This way when the player stops the ground image is what ever frame the animation was in.
The issue is when the player starts to run again. The animations restarts from frame 1 no matter what frame it stopped on.
I tried making rules that kept track of what image the actor was thinking that with each frame cycling it changed the image. my rules looked something like this.
When self images is (image_01) change attribute (self.animation frame) to 1
When self images is (image_02) change attribute (self.animation frame) to 2
When self images is (image_03) change attribute (self.animation frame) to 3
and so on all the way to 12
problem with this is that the action animation does not actually change the self image so this does not keep track so my self attribute (self.animation frame) never change from 0.
Any one know of a way to have a stopped animation pick up where it was paused?
The issue is when the player starts to run again. The animations restarts from frame 1 no matter what frame it stopped on.
I tried making rules that kept track of what image the actor was thinking that with each frame cycling it changed the image. my rules looked something like this.
When self images is (image_01) change attribute (self.animation frame) to 1
When self images is (image_02) change attribute (self.animation frame) to 2
When self images is (image_03) change attribute (self.animation frame) to 3
and so on all the way to 12
problem with this is that the action animation does not actually change the self image so this does not keep track so my self attribute (self.animation frame) never change from 0.
Any one know of a way to have a stopped animation pick up where it was paused?
Comments
figure out the "distance traveled" for each animation frame. then have it so the ground actor constrains self image to what ever the position is divided by the distance each frame changes in a series of 12
basically compare the position so no matter how bug the number is it is in a series of 1,2,3,4,5,6,7,8,9,10,11,12
and starts over
so say every 5 pixels of movement is changes to the next scene. well if your at 100 then it would be 20, which is really 8 since 20 would have gone all the way through the 12 and start back at 1, and go to 8 since 20 was the number
i don't know if that makes sense but i hope u get it