In my project the player is mounted on a boat, so the collider with the shape of a vertical capsule does not conform to the shape of the boat and therefore does not stop on the walls and overlaps them until the capsule collides with the wall, leaving half a boat inside the wall.
How can I make it work with the collider of my choice?