In Godot, if a 3D raycast isn't hitting where you'd expect it to hit, how do you debug it? I'm looking for some way to draw the ray (or a line that follows the ray), problem is, I can't find anything in the docs, so your help is much appreciated.
Sadly there is no easy way to accomplish a "Line3D" in Godot (There are some free assets and third party solutions for that).
However, being for debug purposes, all you have to do is enable "Visible Collision Shapes" on the "Debug" menu.
A common use of RayCast is to do them from the Camera. In which case they probably look like a point. And if you are also updating them every frame, they would follow the camera continuing to look like a point.
In that case, I suggest to duplicate or stop updating the RayCast you want to inspect on a key press. Said another way: Check if the user pressed a key, and when they do, either duplicate or stop updating the RayCast. Then you can move around and see the RayCast from an angle where it does not look like a point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With