See all glossary terms

Delta Time

In game development, delta time is the time that passed since the last frame. It's a decimal number that represents the time between two frames.
If your game runs at 60 frames per second, delta will be approximately 1/60 or 0.01666666666666667 seconds.

Why approximately?

Delta time is not always constant. It can vary depending on the game's performance, how many things are happening at the same time. If may also vary because of external factors, like other applications being open on the computer. If we could ensure delta time was constant, it would be a global variable; but because it can change on each frame cycle, it is passed as a parameter to the _process() and _physics_process() functions in Godot.

Why is delta time important?

Delta time is crucial for making your game framerate-independent. If you use delta time in your game's logic, your game will run at the same speed regardless of the framerate.