Doubt about _physics_process() method

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Peppe

On the official godot documentation it says that the physics_process() method is executed before each physics step. But what exactly does it mean that “it is executed before each physical step”?

:bust_in_silhouette: Reply From: samjmiller

Godot’s physics process is constantly running, at approximately sixty times a second - each “physical step” is 1/60th of a second.

SO anything that you put in physics_process() will happen sixty times a second, meaning it’ll be a major use of processing resources - it’s good for things like motion that are constantly happening, but other actions should be distributed to other functions (ie. if you have a health meter, it doesn’t need to constantly be checking the player HP - set it at the start, and update it every time player HP changes).

Hope this helps!