0 votes

So how does integrate_forces work?

Does it override physicsprocess?
Do they clash when both are called?

Which function is called first?

I'm experimenting with physics and I noticed that sometimes things work only in physicsprocess, while integrate_forces ends up behaving weird.

When both are called in the same script it seems to have random consequences, sometimes it's OK and sometimes not

in Engine by (100 points)

1 Answer

–1 vote

I think you can use both. It depends more on what you do in them.

If you have code that just needs to be executed at constant time step (based on physics_fps), you should use put it in _physics_process(). _integrate_forces() should be used when you need access to PhysicsDirectBodyState for directly changing properties of a body.

by (71 points)
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 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 webmaster@godotengine.org with your username.