Source Academy Modules
    Preparing search index...

    Function delta_time

    • Returns the value of Time.deltaTime in Unity ( roughly saying it's about 1 / instant_frame_rate_per_second )

      This should be useful when implementing timers or constant speed control in Update function.

      For example:

      function update(gameObject){
      const move_speed = 3;
      translate_world(gameObject, 0, 0, move_speed * delta_time());
      }

      By assigning the above code to a GameObject with set_update, that GameObject will move in a constant speed for about 3 units per second along world +Z axis.

      For more information, see https://docs.unity3d.com/ScriptReference/Time-deltaTime.html

      Returns number

      the delta time value in decimal