- Home /
Lowering Time.timeScale and lowering Time.fixedDeltaTime
Hello,
I'm lowering Time.timeScale but according to Unity Docs it states
"If you lower timeScale it is recommended to also lower Time.fixedDeltaTime"
but i'm not sure how much i should multiply the fixedDeltaTime by. I noticed they used 0.02 in the example so one of my question is what or how should i determine the multiplication value because initially just tried something like Time.fixedDeltaTime = Time.timeScale;
but i'm not sure if that's the right thing to do.
Cheers,
read this doc too: https://docs.unity3d.com/ScriptReference/$$anonymous$$onoBehaviour.FixedUpdate.html
by default fixedDeltaTime is running at Time.timeScale. so you are really doing nothing with your code. to speed or slow things you would multiple by a float above or below 1. the physics engine in unity updates at these numbers so obviously its best to keep both numbers in time.
Answer by cdr9042 · Mar 09, 2019 at 10:24 AM
Changing Time.fixedDeltaTime just change the interval in seconds at which physics and other fixed frame rate updates . It's recommended to use 0.02 (50 FixedUpdate per seconds).
If you set Time.fixedDeltaTime = 0.02 * Time.timeScale; then for example, if the timeScale value is 1, then the FixedUpdate will be called 50 times per second.
if the timeScale value is 0.5f, then the FixedUpdate will be called 25 times per second, this keeps the FixedUpdate behavior consistent.
Your answer
Follow this Question
Related Questions
Is there a way to speed up the game more than 100 times? 1 Answer
Unity Time.timeScale is out of range. Any chance to set it to 360? 1 Answer
2nd independent deltaTime and timeScale variables, or a way to mimic this? 1 Answer
How does deltaTime exactly help faster computers? 1 Answer
Is there any way to determine Unity's actual target frame rate? 1 Answer