0 votes

I often use _process(delta) or _fixed_process(delta) in nodes when no physics is needed but the "time" loop from frame to frame with the time between the frame (delta) is needed.
Is there an alternative to _process(delta) but without physics? I mean function that is processed every frame and provide us with delta?
I ask because, especially in mobile games, _process and _fixed_process sometimes cause jitter in movement.

in Engine by (675 points)

If I understand right, nothing uses physics unless you add a node with physics.

'_process' is the regular method used in every game engine where you can touch things before every draw, delta (from delta time) is the time lapse you can use as integrator to avoid jitter.

'fixedprocess' executes every physics frame, a slower and almost fixed delta time, where is advised to manipulate physic objects, again, delta as your friend when moving things.

So, neither process has physics, your jitter could be related to something else (like rounding of some variable).

Thanks! It makes sense that no physics calculation is done when no actual physics node (RigidBody etc.) is used.
The jitter I am talking about: let a sprite move with set_pos(get_pos() + delta * Vector2(100, 0)). When on mobile device the movement is not so smooth (jitter every few frames) as I would expect. There was a discussion in Github about it and it seems to be related to physics but I did not realise that physics calculation is most likely not done when physics bodies are not in the scene even if _process is called.

Oh, it could be this issue https://github.com/godotengine/godot/issues/2043

Affects some Android devices and old GPUs due to problems with OpenGL.
It -may- be solved with the new renderer.

Check if happens with any size and filter of texture, scaling of sprite or with no transparency (you can create it with a shader), maybe there is a way to avoid or conceal the effect.

1 Answer

0 votes
Best answer

Neither _process(delta) or _fixed_process(delta) uses physics unless you add it inside them.
The only real difference is that process runs at every frame, and fixed_process runs at 60 ticks per second.

by (508 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.