Search Unity

Mesh collider not matching with object

Discussion in 'Physics' started by ShaZakLar, Mar 4, 2018.

  1. ShaZakLar

    ShaZakLar

    Joined:
    Mar 5, 2017
    Posts:
    1
    I don't understand why when I add a mesh collider that it is rotated and not matching with the object.. I am creating the maze in blender. There is a 90 degree rotation on the blender file but that was just because I rotated the plane to make it a wall. I can't zero it out of course because it will just rotate the mesh. Any help would be greatly appreciated thanks.
     

    Attached Files:

  2. telecaster

    telecaster

    Joined:
    Jan 6, 2013
    Posts:
    29
  3. arshadameen

    arshadameen

    Joined:
    Mar 5, 2018
    Posts:
    8
    Above source links have valuable content and it has answers of my questions which i have.
     
  4. Keita-kun

    Keita-kun

    Joined:
    Aug 20, 2017
    Posts:
    36
    There isn't one type of issue regarding aligning mesh collider with the object's mesh zizocg has rised onother side of the issue. In my case, it was the rotation and the origin of the object in Blender that didn't translate correctly. IE: mesh is aligned too far in Y axis and rotated 90 degree The SOLUTION 100% working has to be done in your 3D application:
    1. Change the origin /pivot of the mesh collider to match the object you wont to apply mesh collider to it.
    2. Rotated the mesh collider -90 degrees then apply rotation only. rotate again 90 degrees don't apply this time.
    3. when you export use FBX Units Scale
    4. apply all transforms then UNCHECK ROTATION this will reset the origin and adjust size/scale for fbx export we already fixed rotation in step 2.
    5. If you didn't delete the mesh collider from unity assets do it then reimport again
    6. add mesh collider component to your Object they match to the perfection. Blender 2.93.4 / Unity 2019.4.31f1
    original answer link
    http://answers.unity.com/answers/1866820/view.html
     
    Last edited: Oct 19, 2021