Search Unity

OnCollisionExit being falsely triggered

Discussion in 'Physics' started by DavidWFVR, Dec 5, 2018.

  1. DavidWFVR

    DavidWFVR

    Joined:
    Dec 4, 2018
    Posts:
    1
    In our project we are seeing OnCollisionExit events whilst colliders are firmly buried in other colliders. This appears to be a problem only when interacting with static mesh colliders. Hitting other primitives does not appear to be causing this issue. We have taken extra care to ensure the meshes we are using are convex and designed in such a way to keep things easy for the Physics system to manage. Replacing these with primitives for approximate collision reporting is not an option.

    Our setup -
    - Rigidbodies are set as kinematic. We are directly responsible for their movement and they are the child of a cursor object which moves through the scene
    This object contains one or more primitive colliders in its hierarchy - Spheres, capsules, boxes etc.
    - PhysicsManager: Contact Pairs Mode is set to Enable All Contact Pairs.

    As far as I'm aware this should be giving us the results we expect, however we're seeing multiple calls to OnCollisionExit and OnCollisionEnter when passing Kinematic rigidbodies through mesh colliders.

    If anyone has any advice it would be greatly appreciated, thanks!