I'm using a terrain in Unity 2019.2.1f1
and a custom mesh of a cave with a mesh collider.
My character that has a Capsule Collider way bigger than the entry of the cave should not be able to enter in. But due to the roundness of both colliders, he can come into force in the cave, glitching through the terrain collider.
I think it's velocity is not excessive, I'm moving the character with rb.MovePosition()
in the FixedUpdate()
, and I set its rigidbody collision detection to Continuous speculative (tried all the "continuous" modes)
In the animation below, you can see the mesh of the cave and the capsule collider around the character.
How can I prevent this from happening? How can I say to Unity: "I want the colliders to be rock solid and not marshmallow"?
rb.AddForce
instead ofrb.MovePosition
– RuzihmMovePosition
but since this problem, I think I will use a mix ofAddForce
and RootMotion (thanks to theOnAnimatorMove()
callback). – Maarti