- Home /
Altering Fixed Timestep when your game is running to allow for smooth low Timescale animation.
I am working on a special cinema that plays in what I would call "super slow motion" (About 0.05 TimeScale) this looks great with the Fixed Timestep all the way down to .0001.
However, I am running this on an iPhone, and I don't need my Fixed Timestep that low for about 99% of the game, only when this special cinematic is triggered.
Keeping the Timestep at where it is (.005), results in a "jumpy" cinematic because the game is only rendering a frame about twice every second (.005 refers to a fraction of a second at timeScale 1.0)
It doesn't appear there is any script reference for Fixed Timestep, I'm guessing the "Fixed" means I can't alter this once my game engine starts up. Has anyone run into this problem, and found a workaround?
Thank you.
Answer by jjobby · Sep 16, 2010 at 04:59 PM
You can change fixedupdate time in the script by setting value to Time.fixedDeltaTime instead
Time.fixedDeltaTime = 0.0001f;
http://unity3d.com/support/documentation/ScriptReference/Time-timeScale.html
Answer by spinaljack · Aug 12, 2010 at 08:06 AM
"Fixed" Time Step doesn't mean you can't change it at run time (I do it all the time for pausing and slow mo), it's called fixed because it occurs at regular intervals regardless of frames rendered. It should only be used for physics related situations and altering it to slow down animations is not ideal.
Typically on iPhone I keep the fixed time step at 0.06, setting it lower would kill the performance for most games with any number of rigidbodies or particles because the physics simulation occurs much more frequently and the iPhone's hardware is not suited to physics calculations.
Use animation speed instead:
http://unity3d.com/support/documentation/ScriptReference/AnimationState-speed.html
$$anonymous$$y Fixed Timestep has to be that high because I'm working on a physics-heavy game, and if I don't keep it that high, the physics reactions aren't detailed enough and I get things like objects flying through walls and unrealistic patterns. I pay the performance price by reducing my draw calls and tris.
Unfortunately, I don't believe speeding up the AnimationState here helps me because I'm not using Animation State, I'm using the physics engine, and I want to dramatically slow down the action. When I do that, it looks like a slide show, because there's maybe only two "Fixed Updates."
Your answer
Follow this Question
Related Questions
how to get smooth slow motion? 4 Answers
Slow motion problem 1 Answer
Heres a Script for SloMo hold left shift 3 Answers
Time.timeScale question 1 Answer