I have two character controllers, both with the same height 1.2m and the same step offset 0.5m, but colliding one onto another, CharacterController instead of stopping the movement at that direction, jumps over.
Picture showing whats happening:
CharacterController settings:
If I reduce the step offset to 0.3m they cannot walk over themselves but neither over the terrain surface properly.
Does anyone have an idea on how to solve this or why it’s is happening?
Thanks.
The problem is in the step offset.
The character controler is “static”, it cant be moved by external forces, only by CharacterController.move() or sampleMove().
The best idea will be:
-Remove the character controller and add a rigidbody (and a capsule collider).
-In rigidbody constraints, freeze all rotations.
-Finally, in your movement code instead of characterController.Move(the movement vector you use), use Rigidbody.velocity = the same vector of the characterController.move.
Oh and turn off the gravity in the rigidbody.
This should make a similar movement, with the difference that the rigidbody will not stop instantly, the characters will “Slide” when the case that you said and that the characters will be able to push other characters.
Hope you understand this.