x


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?

more ▼

asked Mar 09, 2013 at 08:41 AM

xEnOnn gravatar image

xEnOnn
180 106 88 91

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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

more ▼

answered Mar 09, 2013 at 08:52 AM

MountDoomTeam gravatar image

MountDoomTeam
1.2k 197 192 210

Does it mean it will only work on the side with the normal vector pointing forward?

Mar 09, 2013 at 09:38 AM xEnOnn
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2881
x391
x207

asked: Mar 09, 2013 at 08:41 AM

Seen: 1076 times

Last Updated: Mar 09, 2013 at 09:38 AM