Search Unity

Do capsule casts work with concave colliders?

Discussion in 'Physics' started by Tiernan98, Dec 18, 2020.

  1. Tiernan98

    Tiernan98

    Joined:
    Jul 11, 2017
    Posts:
    42
    Hi,

    I built my own character controller (like Unity's but with different behaviour) and I spent days getting it working properly with stepping, slope handling, etc. It handles my test environment of different shapes really well and I have not been able to make my player go through any objects. The test environment is made up of convex colliders like boxes.

    However, when I try to use my controller in a level with a concave mesh collider. To give you an idea of the scale, the whole level's collision is contained in one big mesh that is concave, so the player can be right down on the inside of it if that makes sense. I know its weird and the whole level should not be one big mesh collider but it is the only format I have access to for it.

    Now Unity's Character Controller was able to handle this no problem, I could not go through any walls on this level, but with my controller, some walls stop the player and others don't. Is this an issue with using capsule cast?

    Clearly, there is a way to make this work because Unity themselves have, but my capsule casts (the amount the player wants to move) just aren't detecting the walls in the level well. Yet, the floor is completely fine (a sphere cast).