Search Unity

  1. Unity 2020.2 has been released.
    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

Two colliders pass through each other at certain angles

Discussion in 'Physics' started by litebox, Feb 15, 2017.

  1. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    139
    After update to Unity 5.5 from Unity 5.4 we have noticed this bug: our Vehicles (Rigidbody with BoxCollider) start to pass through the Road Side Walls (Static MeshCollider), this happens only on iOS and only at certain angles between Vehicle and the Wall:
    collider-test.jpg
    On screenshot you can see what I'm talking about: red cube with BoxCollider pass through the MeshCollider.

    The only workaround is to set different angles for objects with MeshColliders, e.g. we have set of road elements (track constructor) and place them with 0-90-180 degrees to each other, to minimize this bug we have to place this objects like 5-95-175 degrees, etc.

    Here you can see a short video from iPad: https://dl.dropboxusercontent.com/u/104182758/collision-bug.mov
    And here the same scene, but with slightly rotated around Y road element, bug doesn't reproduce: https://dl.dropboxusercontent.com/u/104182758/collision-bug-workaround.mov

    We had sent this bug to Unity: https://issuetracker.unity3d.com/is...ough-each-other-at-certain-angles-on-ios-only

    Also we would like to warn about this bug because if you use MeshColliders and build games for iOS - you also has it, but it's not easy to catch it. But when it occurs - all in games goes wrong because players could walk where developers don't expect them.
     
  2. roman-malinkin

    roman-malinkin

    Joined:
    Nov 6, 2014
    Posts:
    2
    I had this problem also, had to replace mesh colliders with set of box colliders.
     
  3. nexxstudio

    nexxstudio

    Joined:
    Feb 18, 2015
    Posts:
    3
    We're experiencing this problem as well. A downgrade to Unity 5.4 fixes the issue. Does anyone have a solution?
     
  4. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    139
    No, the bug is still in Open state. The downgrade is not a bad solution, if you didn't save Scenes/Prefabs with Unity 5.5 - because of changes in serialization, Unity 5.4 doesn't open Scenes, saved with Unity 5.5 - in our case this is a big deal.
    We have to revert to old revision of project, then manually re-implement changes, we made with Unity 5.5, in Unity 5.4 :confused:
     
  5. Snoop-Kakapo

    Snoop-Kakapo

    Joined:
    Nov 23, 2015
    Posts:
    2
    We have the same issue if rb drag value of gameobject with box collider is higher than the default value.

    Test scene (Unity 5.5.2p1):
    - ground gameobject with static mesh collider
    - moving gameobject with box collider and rb/continues dynamic collision detection (if rb drag value is 0.5 so collision is ok, if rb drag value is 12, gameobject very often goes through a ground/mesh collider
     
  6. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    139
    Thank you for replay, I've tried to test my situation with different drag values and noticed, if I set drag 5 or 10 - the object collides as expected. Then I understand, that when I increase drag I also increase force applying to the object to move it.
    So, then I returned to my common drag 0.1, but leave bigger force - in this case my objects move really quick, but they collide with static wall colliders as expected.

    So, the different forces affect on this bug, so the collider's rotation angles.
    In general it looks, like my object works as Discreet Collision Detection works, and it ignores Continues Collision Detection as I had set to it.
     
  7. litebox

    litebox

    Joined:
    Aug 29, 2011
    Posts:
    139
    Got workaround from Unity Devs:
    Go to Edit > Project Settings > Physics and disable PCM Generation
     
  8. Snoop-Kakapo

    Snoop-Kakapo

    Joined:
    Nov 23, 2015
    Posts:
    2
    litebox: i will try
    I'm gonna try. Thanks for tip!
     
  9. jertte

    jertte

    Joined:
    Jun 18, 2018
    Posts:
    6
unityunity