physics.setTimeStep()

Type Function
Library physics.*
Return value none
Revision Release 2024.3703
Keywords physics, frame-based physics, time-based physics, time scale
See also physics.setScale()

Overview

Specifies either a frame-based (approximated) physics simulation or a time-based simulation.

Syntax

physics.setTimeStep( dt )
dt (required)

Number. Value of physics “time step” in seconds, meaning the time between each physics update in seconds.

  • Use 0 to get an approximate time-based physics simulation.
  • Use -1 to get default behavior (frame-based).
  • Use 1/30 for 30 updates per second.
  • Use 1/60 for 60 updates per second.

Example

physics.setTimeStep( 0 )  -- Time-based physics simulation