- Home /
Are Raycasts supposed to be able to detect the bottom of a terrain?
I was testing some code with Raycasts to see if an object was above or below the terrain, and I noticed it only worked for the above the terrain portion The below the terrain portion was not getting a Raycast hit (I verified this with Debug.DrawRay() so I know it should have hit the terrain).
I checked by rotating the object, and it looks like the Raycast will only collide with the terrain when the Ray hits the top of the terrain. Is this intended behavior? And is there any way to allow for the Ray to hit the bottom of the terrain?
The only "solution" I can think of is to flip the Ray around and shoot it from the other side, but for an infinitely long Ray, that could be a problem. Luckily I don't need that, but I could see a scenario where you might want that.
I'm using Unity 2020.1.0f1 in case this is a version thing.
Your answer
Follow this Question
Related Questions
Physics Materials on SpeedTree? 0 Answers
Terrain collider is inaccurate 3 Answers
Terrain heightmap resolution affects collision calculation 0 Answers
Unity tree colliders acting very strange 0 Answers