Raycast ignores objects with colliders


I am currently facing an issue with Raycast and objects with colliders.
I am shooting a ray from the player hips to the ground but the line goes through the object and completely ignores it. I am trying to get the distance between the player and the first collided object.
Here’s a view :
alt text

As you can see, the ground works fine as the hit is not shown because the distance between the player and the first hit object is less that 1.5

Any idea on how to fix that?

Many thanks!

I had the same problem. It looks like you are using Probuilder. For some reason mesh colliders do not work very well. Some people said to mark the checkbox for Convex but it screwed up my project. What I did was substitute the mesh collider for a native box collider and it worked.