Mesh collider not working after rotation
I would like to create a polygon on a GameObject at runtime.
I do the following at runtime:
1. Create GameObject (GO)
2. Add polygon component to GO
3. Define points with .AddPoints --> Creates polygon on the XY plane of the GO
4. Add a mesh collider
5. Rotate the GO so the polygon is pointing up (Y world). Because I need it on the XY world plane
6. Trying to raycast on the polygon doesn't work. The meshcollider gets a hit only in the original position (GO euler angles = (0,0,0)) and not when rotated ((90,0,0)).
I tried to call the UpdateMesh(true) after step 3, but it doesn't work.
I tried to define a GO (not at runtime), adding a meshcollider and it still doesn't work. It works only with a boxcollider.
I am not sure it's a bug or I am missing something with the colliders and how the mesh is defined in a polygon.
Is this an expected behaviour?