Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Small mesh shapes do not collide

Discussion in 'Physics for ECS' started by SimonCVintecc, Jan 17, 2020.

  1. SimonCVintecc

    SimonCVintecc

    Joined:
    Jun 4, 2019
    Posts:
    8
    A great feature of the DOTS physics solutions is that it allows dynamic physics bodies with non-convex mesh colliders.
    However, it seems like no collisions occur when the object is too small (less than 15x15x15 mm).

    A simple test is the following:
    - Create a cube with scale 0.015, add a PhysicsBody and PhysicsShape of type Box
    - Create a cube with scale 0.015, add a PhysicsBody and PhysicsShape of type Mesh

    Result: The Box shape does collide while the Mesh shape does not
    (The result is the same regardless of using Unity Physics or Havok)

    Is there a lower limit on mesh collider shapes that I'm unaware of? Or is this a bug?
     
  2. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    Hi there! So the problem in this case is that the entire mesh ends up being simplified into nonexistence when the triangles are that small. I'll figure out what the correct outcome should be on our end, but I would recommend you use a primitive (sphere or capsule) for really small shapes like this anyway, as the solver won't have enough precision. Otherwise you'd just have the performance penalty of using a mesh collider without the benefit of any discernible difference in collision. If your game takes place at a small scale (e.g., characters are insects) then you should just treat all your linear units as though they are centimeters or millimeters or similar.
     
    MNNoxMortem and SimonCVintecc like this.
  3. mmotrifork

    mmotrifork

    Joined:
    Sep 17, 2018
    Posts:
    2
    What would be the process of making that scale change @Adam-Mechtley ? Which parameters must be tweaked?
    We have a similar situation and increasing the gravity on the PhysicsStep component is not enough since colliders starts clipping into each other.