Sometimes the KCC stucks when colliding with
Convex option enabled, even on flat surface. This is caused by incorrect penetration vector and is fixed in Unity 2023.2. Link to Unity Issue Tracker.
There are 2 possible solutions:
Convextoggle on the
MeshCollider. Optionally create a separate mesh collider which will be used instead of the original mesh.
Suppress Convex Mesh Collidersin KCC Settings, this will automatically use the non-convex shape for collisions at runtime.
Unfortunately terrain trees are not supported.
UnityEngine.Physics.ComputePenetration() returns incorrect penetration vector for
TerrainCollider when the KCC overlaps trees, completely ignoring them.
As a workaround, extra shape cast is needed (not yet implemented as default feature).