Raycast Doesn't Like Mesh Collider?

I have a raycast that clearly see’s other colliders (Box Collider for example, so I can verify the raycast is functioning correctly), yet it doesn’t see a Mesh Collider. This surprises me actually since the Character Controller (using Mecanim as well) works fine with my various Mesh Colliders making up my hand-built terrain geometry.

Mind you I’m aware mesh colliders are more expensive, but I’m curious as to why raycasting doesn’t work.

Thanks!!

EDIT: Yes they’re concave, and I’m aware that another collider would need to be convex to interact with it; this is JUST a raycast…

Raycasts work fine with mesh colliders. Remember that the OnMouseEtc functions use raycasting, so if OnMouseWhatever works then your own raycast will work. The same rules apply to raycasting that apply to collisions (i.e., they go through back faces).

–Eric

Hmmm…then I’m at a complete loss. I’ve tried every combination of option just to see it fire (doing a boolean on detection).

Is it possible because the mesh is open that raycast isn’t keen on it?

Appreciate you popping in here Eric, thank you.

SighIgnore Raycast layer was selected. If I were to be perfectly honest though, I thought if I didn’t choose ‘any’ layers for raycast to ignore, that it would check every object regardless of the layer the object was in.

Works now…c’est la vie. :smile: