Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Mesh Collider is not accurate (skipping the "inside" of the mesh)

Discussion in 'Physics' started by iterbit, Aug 20, 2019.

  1. iterbit

    iterbit

    Joined:
    Apr 25, 2016
    Posts:
    12
    So basically here is my mesh or game object. You can also see that the mesh collider is not wrapping the "inside" of the magnet (if this is the correct term).


    magnet.png

    Another thing is that I have a lot of mazes created in third party modeling tools and I'm encountering a similar issue:

    maze1.png

    Any ideas on how to solve this greatly appreciated!
     
  2. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    84
    If it's a dynamic object mesh collider must be convex to work. So you have to approximate your object with multiple convex colliders to simulate concave.

    If it's a static collider (no rigidbody) it can be concave, you just have to uncheck convex on mesh collider.
     
    technicat likes this.
  3. SparrowsNest

    SparrowsNest

    Joined:
    Apr 6, 2017
    Posts:
    1,850
    You either have a static concave mesh like @koirat said or you should make a compound collider, for example the maze - make box colliders that approximate the walls and have both the "physical" version and the visual version overlapping.
     
    technicat likes this.