Game Development Community

Frame Rate

by Georgina Benedetti · in Torque X 2D · 11/25/2010 (4:17 am) · 9 replies

Is there a way I can set a Frame rate using code? I want to make an animation gradually get faster...

#1
04/30/2011 (12:50 am)
Any news on this?
#2
04/30/2011 (11:29 am)
I use the GameTimeScale for slow motion in my game
Game.Instance.Engine.GameTimeScale = 0.5f;

If you want individual objects to have different speeds then you might check out what Ron is talking about in this thread: [url=http://www.garagegames.com/community/forums/viewthread/68875]Slow Motion Method[url].
#3
05/02/2011 (2:41 am)
Thanks :) Will check it out
#4
05/04/2011 (5:38 pm)
Whoooooooooooooooa why don't you just change the frame rate of the animation not the whole game?
#5
05/04/2011 (8:08 pm)
yeah just asking which var/method I use to do that :)
#6
05/05/2011 (3:29 am)
@Aaron: wrong link?
#7
05/05/2011 (12:15 pm)
If it's like TGB then I think it's:

myAnimation.animationTime = 1.0;
myAnimatedObject.setAnimation( testAnimation );

You call setAnimation or StartAnimation to have Torque reload the data, animationTime is how many seconds to animate all the frames once (so 5 frames at 1.0 is 5fps, 5 frames at 0.5 is 10fps).
#8
05/05/2011 (3:22 pm)
Alistair: Sweet! exactly what I was looking for! Thank you! :) I'll have a play with it tonight.
#9
10/27/2012 (6:58 pm)
Thanks, I couldn't find this in the documentation at all.

It doesn't quite do what I want though. I have a walking character, I want the walking animation to play at a higher speed when he's running, and freeze when he stops.

If the character stops walking and starts again, I want the walking animation to pick up where it left off.

Do you know how to change the framerate of an animation as it's playing, without having to use setAnimation() afterwards?