How to detect CSG with raycasts (or other static geometry)?

Godot Version

v4.4.1

Question

Hi, I was wondering if it’s possible for raycast3Ds to detect CSG objects, or other non-rigibody static geo. I have some raycasts that are working great on rigidbodies, but I’m trying to do wall detection for a ledge climbing system and the raycasts don’t seem to work on CSG.

Is this possible? What am I missing?

I have tried using both RayCast3D nodes and generating raycasts via code – same result with both. I have the collision mask for the raycast set to layer 1, and the CSG are all on collision layer 1.

Thanks in advance!

It should work. Make sure that use_collision flag is enabled on csg nodes.

1 Like

Ahh I see what I did wrong! I was sending my raycast from the player’s feet, and the bottom of my CSG wall was about 0.01m above the ground, so the raycast slipped through the crack. I’ve adjusted my geo and now everything works :slight_smile:

1 Like