Game Development Community

Stop animation

by Amjad Yahya · in Torque Game Builder · 07/08/2012 (8:11 am) · 3 replies

Hello,

Is there any way to make an animation pause (freeze Animation) without using $timescale? I want to be able to move the camera after I freeze certain animations.

If this needs a source code changes please show me how.

Thanks in advance

#1
07/08/2012 (4:41 pm)
Well, it's not pretty.. but when you want the animations to freeze you could replace them with static sprites of the current frame. Then when it restarts, replace the static sprites with the animations. You can use getAnimationFrame() to pull out which frame it is on, and setAnimationFrame(%frame) to restart a new animation from that frame.
#2
07/08/2012 (11:44 pm)
Thanks Harry, this will work too, although I was hoping for a pauseAnimation() method that can be added using the source code. Maybe this will be added to the next version of T2D.

Not only we have to determine at which frame the animation paused, but also we need to know the name of the image map, it's doable but as you stated, it's not pretty.

Thanks again.
#3
08/12/2012 (1:57 am)
just found what I'm looking for, actually there is a certain method that will pause the animation along with the physics of the object its setPaused(true), setPaused(false) will unpuase the object.