Unity rays cannot detect terrain

In order to achieve that the camera is not occluded, I do ray detection from the camera to the direction of the person, but my terrain cannot be ray detected.

I thought it was a Terrain Collider problem, but I suddenly remembered that the distance detection on the bottom of the character's feet works.

This confuses me.

Then I decided to ray detect from inside the character in the direction of the camera, and I ended up detecting the terrain, but not the character itself, which was perfect. This shows that the ray detection is one-sided and can only detect the outer surface of the collision body.

Guess you like

Origin blog.csdn.net/weixin_43673589/article/details/123631107