Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Small mesh shapes do not collide

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

  1. SimonCVintecc


    Jun 4, 2019
    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


    Unity Technologies

    Feb 5, 2007
    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


    Sep 17, 2018
    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.