0 votes

Is there a way to increase the rate of raycasts updating? I keep having an issue where my collision is happening but it's either too late or too soon. It's making things look super weird because I want an "obstacle" to stop moving as soon as the raycast(s) have hit something. Sometimes they float above another object, or they go a little too far in and they clip through.

Edit: I've used _process() but obviously relying on frame rate is not reliable.

Godot version Godot Engine v3.2.3.stable.official
in Engine by (18 points)

1 Answer

0 votes

You can change update rate in the project settings, under Physics/Common/Physics FPS.

Collisions should be checked inside _physics_process() instead of _process().
If your obstacles stop moving a bit too late, or early, you can try to have them move to their position on the last tic, or stop only on the next one.
Finally, maybe you would have better luck using Areas instead?

by (2,276 points)
edited by

I tried increasing the physics update but that messes up some other physics related things (will prob try again and just adjust for the new rate). I did try using area and had the same issue of it updating too late or too early.

Do areas update quicker than raycasts or at the physics rate as well?

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.