You are able to modify the speed of most objects, animations and physics using a single value: `Time.timeScale`. Modifying this value from it’s default (`1`) causes the game to run slower (values less than 1) or faster (values greater than 1).
An important note of using this: adjusting the Time Scale does not effect the framerate of your game (at least not directly). It will scale the results of `Time.deltaTime` and `Time.fixedDeltaTime` and reduce the speed of animations and physics in your scene.
## Some Examples
### Stop Time
“`csharp
Time.timeScale = 0;
“`
### Half Speed
“`csharp
Time.timeScale = 0.5f;
“`
### Normal (Default) Speed
“`csharp
Time.timeScale = 1;
“`
### Double Speed
“`csharp
Time.timeScale = 2
“`
## References
The original Dice Roller video is here:
You can read more about using `Time.timeScale` on Unity’s documentation site:
I use the Warrior Pack Bundle 1 to demo this. It’s available as a paid and free asset.
– Paid:
– Free:
Join the World of Zero Discord Server:
toto je taky fake ja hladam uplne niečo iné a nie taketo sračky nechapem načo si tam dá na nadpisu to čo tam vôbec nerobí
thank you really useful!
Actually you would also need to change how often your game will call your updates functions because as you can see it looks really laggy. Unity uses the timeScale to also scale the number of updates per second so if you want to keep your updates at 60fps or whatever you need to divide it by your time scale (or multiply by 1/timeScale) 😉
thanks man it helped a lot
I did the exact thing you did, checked if I made any mistakes in the script but it’s still not working
How can I modify the time automatically through the game, for an example: i want the time to speed up the longer the player is in a level.
can use use something like timestep to make the jumps in time less blocky?
Hey Zero! I am a new subscriber and also new to unity but have been using Unreal for a long time.
I really like the tuts however i have one confusion with Character Controllers in unity. I was hoping you can point to the right direction. Should we use Built in Character Controller or go primitive using KRigidbodies what do you recommend? Which is better? You got any tutorial on this topic? There are so many things and so many ways Controllers are made and many having limitations.
I didn't mention this in the video but in hindsight probably should have: adjusting the Time Scale is not adjusting the frame rate of your game. It's adjusting the amount of change that happens during each step of your games simulation, not the time between each step of your simulation.