Search Unity

Custom collision handling has occasional tunneling on mesh colliders

Discussion in 'Physics' started by Chippybippers, Sep 25, 2019.

  1. Chippybippers

    Chippybippers

    Joined:
    Sep 18, 2017
    Posts:
    5
    I need a character controller similar to the one pre-packaged with Unity. However, the behavior of CharacterController is too limited for my needs (can't rotate, slopeLimit stuff is generally too restrictive) so I've been working on my own implementation. I've got the essentials - Raycasts are performed with a contact offset, and overlaps are detected/resolved once per frame. This works well & good with any of the primitive shape colliders, but mesh colliders still give me trouble. At certain angles & positions my character will pass right through the collider.

    Am I missing anything obvious from this implementation? In addition, have there been any proper writeups on creating this sort of character controller? I've looked around a good deal, but haven't come across any formal documentation.