Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. In2Play

    In2Play

    Joined:
    Apr 25, 2016
    Posts:
    66
    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:
    2,068
    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.
     
    Deleted User likes this.
  3. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    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.
     
    Deleted User likes this.