Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Collisions with concave mesh collider don't work on iOS

Discussion in 'Physics' started by ditrytus, Mar 12, 2017.

  1. ditrytus

    ditrytus

    Joined:
    Mar 12, 2017
    Posts:
    5
    I am having a problem with collisions not being detected between sphere collider and a mesh collider, but only when I run it on iOS. Everything works fine in the editor and in os x build. The setup is that a ball with rigid body should fall on an object with custom mesh collider, but instead it passes through. The ball is not moving very fast. Also on iOS the problem happens randomly, for most of the times there is no collision, but once every 10 or so restarts it works fine. Problem also seems to affect only mesh colliders with concave meshes and not convex ones (and I mean an actual shape not a collider setting).

    I've been trying the following things and none of them worked:
    1. Setting convex on a mesh collider.
    2. Attaching kinematic rigid body to mesh collider.
    3. Making mesh collider static.
    4. Setting "Continous" and "Continous Dynamic" collision detection.
    5. I double checked layers collision matrix.
    6. None colliders are triggers.
    7. Normals on my mesh are pointing out, I tried "Calculate" normals in import settings.
    8. In my test project one collider is very thick.
    9. Decreasing fixed time step and time scale in TimeManager.
    10. Decreasing Default Contract Offset in PhysicsManager.
    11. Increasing Solver Iterations and Solver Velocity Iterations PhysicsManager.
    12. Setting "Prebake collision meshes" in PlayerSettings.
    I created a simple test project that demonstrates the problem.
     

    Attached Files:

  2. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    138
  3. ditrytus

    ditrytus

    Joined:
    Mar 12, 2017
    Posts:
    5
    Thank you very much! I went through all the phases of denial, anger etc. with this issue and I really hoped it's just a bug in unity. If the bug is filed than I'll trust they will resolve it eventually. And downgrading to Unity 5.4 is still an option for me. Thanks again!
     
  4. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    138
    Yeap, I hope they will fix it as well, I believe physical bugs must have some priority, because they affect game very heavily, and produce a lot of additional bugs. But bug has open state two months already, so my hope is melting.

    Also, I recommend you downgrade to Unity 5.4 as soon as possible, because once you save scenes/prefabs with Unity 5.5, you will not be able to reopen them with Unity 5.4 - this is a big deal in my situation now.
     
  5. ditrytus

    ditrytus

    Joined:
    Mar 12, 2017
    Posts:
    5
    Unity 5.4 it is! Thanks again for advice.
     
  6. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    679
    Hm interesting... I'm using a similar setup with a sphere rolling on all kinds of mesh colliders, but I didn't encounter any problems with Unity 5.5, the problem however starts to appear (for not only concave meshes) in Unity 5.6 beta (tested with b11) once the sphere has a certain velocity (rigidbody is set to continuous dynamic detection).
     
unityunity