ME FIRST GAMES
Menu
games for me and you
![]() 📌 In Unity, Time.deltaTime is the competition time in seconds since the last frame. Using deltaTime in your game is critical to getting things to move and update properly when the framerate fluctuates. 📌 Unity will execute at X frames per second (the default is 60). This means Update() and rendering will occur 60 times each second. For every frame, deltaTime is the time since the last frame. 📌 Time.timeScale can be assigned to slow down or speed up time. A value of 0.5 will cause your game to run 50% slower. In real-time, your game will still execute at 60 fps, however, Time.deltaTime will be increasing at 50%. 📌 Slow-motion effects can easily be invoked by assigning Time.timeScale and using Time.deltaTime in your calculations. 📌 Time.time is the seconds since the start of the game. Like Time.deltaTime, this value is affected by the timeScale. 📌 Time.unscaledDeltaTime is the interval in seconds since the last frame, however, this value is not affected by timeScale. This is great for updating objects that you don't want to be affected by slow-motion, like camera movement or HUD animations. 📌 Time.unscaledTime is the seconds since the start of the game, but unaffected by the timeScale. 📌 Time.fixedDeltaTime and Time.fixedTime are used specifically for physics, which typically runs at a different framerate. FixedUpdate() methods should use these values. 📌 Using the wrong deltaTime can lead to some funky behavior, whether it's player movement behaving inconsistently among different devices, you must learn to master Time in Unity.
0 Comments
Leave a Reply. |
Me First Games is an independent game studio dedicated to creating unique and bizarre video games.
Red MatterStar Impact is an upcoming adventure platformer coming to PC, Mac, and Linux.
Archives
April 2021
Categories |
Copyright (c) 2020 Me First LLC
|