- Home /
Raycast doesn't work from beneath MeshCollider?
I have a plane with a MeshCollider, and it has weird problems with raycasting. It seems that when I cast a ray from the top of the plane, it works fine. The raycast can detect that it hits the plane. But when I cast a ray from the bottom of the plane, it doesn't detect that it hits the plane. I drew a line and the ray should hit the plane.
When I change the MeshCollider to BoxCollider, the rays work correctly.
Is there any reason for this problem? How can can I shoot a ray from beneath the plane with a MeshCollider?
Answer by MountDoomTeam · Mar 09, 2013 at 08:52 AM
Hello, can you see the mesh from both sides? Yes Colliders are mostly made to work just in one direction, there may be a workaround for double sided planes, although in games they normally have 2 planes http://answers.unity3d.com/questions/126196/physicsraycast-not-hitting-backside-of-meshpoly.html
Does it mean it will only work on the side with the normal vector pointing forward?
Your answer
Follow this Question
Related Questions
Math - calculate position in world space from ray on infinite plane 2 Answers
Mesh collider as bullet hit detection performance 2 Answers
Plane.Raycast layerMask? Using both Physics and Plane raycast 0 Answers
how to check if 1 sided plane is facing the camera 1 Answer
Detecting how many times a raycast collides with a single concave meshcollider 2 Answers