_process(delta) question

Godot 4.3

I noticed in the docs that the method:

_process(delta: float) virtual

This is a method for both Node and MainLoop. Do you know the reason for this? _physics_process() is also shared.

1 Like

MainLoop is a pretty advanced class that you probably don’t need to use if you’re just starting out. MainLoop controls how each frame and physics update is handled for the whole engine (like which components to process first, or when to skip frames, etc.).
Node is an individual component within the engine and it’s functions are called by MainLoop every frame/physics update.

If you make your own MainLoop class, you will have to provide the logic to iterate over all nodes and call all the Node._process functions each time MainLoop._process is called, and call all Node._physics_process functions each time MainLoop._physics_process is called.

_process is called every time the screen updates.
_physics_process is called every time the physics updates.

1 Like

Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.