What’s the difference between _physics_process() and _process()?

Question

Pretty simple question I’ve got.

_physics_process() runs it’s contents every physics frame. Pretty simple. So what the heck is _process() and why would I want to use it over _physics_process()?

_process() runs prior to every rendered frame. You can use it to update everything that’s not tied to physics engine.

So _process() is dependent on frame time and _physics_process() is dependent on engine time?

What do you mean by “dependent on time”?

Depending on your project settings, those two may run at different frequencies. _process() will be tied to your rendered fps, and _physics_process() to your physics ticks. You can adjust both in project settings.

They can be fully in sync, for example both running 60 times per second (which will likely be the case by default) or can run each at its own rate. You can run multiple physics ticks per rendered frame or vice versa.

A typical example: If you’re running heavy physics, you might want to set the tick rate to 30 per seconds for optimal performance, while you’re still rendering at 60 frames per second. So if you’re animating some non-physics stuff via code, it’s better to do it in _process(), resulting in smoother visual update happening every rendered frame.