Search Unity

Mesh Collider incorrectly generating convex collider

Discussion in 'Physics' started by cloui, Jan 31, 2019.

  1. cloui

    cloui

    Joined:
    Oct 24, 2018
    Posts:
    7
    Hi

    When i enable convex for my mesh collider the collider is not aligned with the mesh or generated correctly. Is my model wrong?

    This was working in unity 2017
     

    Attached Files:

  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,356
    It could be that the object is badly made, with split faces or flipped normals, so perhaps a new routine failed to care for those edge cases. Can you submit a bug report with the object so Unity can look at it please :) post number in here.
     
  3. cloui

    cloui

    Joined:
    Oct 24, 2018
    Posts:
    7

    Attached Files:

  4. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    284
    As far as I can see here, the resulting convex for this segment looks like the initial tetrahedron generated by Quickhull. It should have expanded the hull starting from that and following outside of the tetrahedron's faces, however that didn't happen. I would imagine that's connected to the fact that the torus is actually rather tiny so the precision issues creep in here. I see that the you scale the torus x100 in Unity, but that won't help with precision since we first bake and only then supply scale. Would it help if you apply at least some of the scaling to vertices in the 3d editor (Blender/Maya/etc)
     
    cloui, AlanMattano and hippocoder like this.
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,356
    To add to what was said I would suggest everyone adopt a 1 meter = 1 unit measurement and test that's working for them with a cube imported aligned with a Unity cube.
     
    cloui and yant like this.
  6. RichardCulver

    RichardCulver

    Joined:
    Nov 19, 2013
    Posts:
    4
    I am the graphics artist working on this project. This is an issue with the fbx import in Unity as well as export settings in the source app. If the source app is 1 to 1 (such as Maya) then there is never a visible issue. If you change the scale settings in Maya or use something like Blender, I see this every time. I have checked all of the options in Blender and Maya for Export as well as all of the settings for Model Import in Unity and have not found a way to correct this other than to simply port everything over to Maya and export from there. But for the projects I am working on here with rigs, bones and 100's of collision objects this will mean possibly weeks worth of work that will have to be redone in Maya.

    It would be real nice if there was a setting in Unity that would actually truly apply the scale of the object on Import. I have not found the setting that does this in Model Import Settings.

    In Blender I can do this with a simple object. There is an experimental "apply scale" feature. But it does not work with parenting and rigs, and other more real case scenario situations.

    Am I missing a setting in Unity?
     
    Last edited: Feb 21, 2019