0 votes

I'm trying to cast some rays a bunch of times using DirectSpaceState.intersect_ray(), here i get the hit point by doing hit["position"] where hit is the result of the raycast.
For some reason the hit points are not accurate and appear at seemingly random positions.
However if i put a delay in between by doing yield(get_tree(), "physics_frame")
This makes everything work, but it's too slow now because it waits every frame.

Godot version v3.4.4.stable.mono.official [419e713a2]
in Engine by (30 points)

How are the rays being sent out? Individually? In a for loop? Sharing some more of the code would shine a light on the problem.

1 Answer

0 votes
by (251 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 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.