ME FIRST GAMES
Menu

games for me and you

What is Delta Time?

6/7/2020

0 Comments

 
Picture
📌 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.

    Picture
    Me First Games is an independent game studio dedicated to creating unique and bizarre video games.
    GAMES HERE

    Red Matter

    Star Impact is an upcoming adventure platformer coming to PC, Mac, and Linux.

    Archives

    April 2021
    February 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    April 2019
    March 2019
    December 2018
    April 2018

    Categories

    All

    RSS Feed

Copyright (c) 2020 Me First LLC
  • STU the First AI
  • Blog
  • Contact
  • Unity Tools
    • Hierarchy Comments
  • STU the First AI
  • Blog
  • Contact
  • Unity Tools
    • Hierarchy Comments