Does work the raycast on a mesh collider?

Hello everybody!!

I found some similar questions, but or I don’t understand the answer or does not solve my situation.

I have a mesh collider and when I try to raycast to it, I dont success; if I replace the mesh collider with a primitive collider (box collider) then I get the raycasthit object. I’m making the ray from the camera.

Is that a bug? there are solutions?

Raycasts work fine with mesh colliders, and there is no bug. Either your raycast or mesh collider is wrong somehow.

You where right, the raycast was fine, I wrote in the forum of 2DToolkit, and somebody told me this

Set “collider cap” on the mesh colliders, and commit your sprite collection. By default no cap is generated.

So I set the “Collider Cap” to “Front” and now works.

Thanks for the help!