My problem is when a character controller moves towards an oncoming rigidbody, the controller partially passes through the rigidbody before being pushed back and I don’t know how to stop this.
I’m using
rigidbody.MovePosition(rigidbody.position + _directionSpeedTime.deltaTime);
To move my rigidbody, and a modified version of the default fpswalker script (to allow all jumping etc) for the controller.
A video of the problem can be found here: http://bovinelabs.com/crush/crush/
The demo there just has a kinematic rigidbody oscillating between 2 points, (with a trigger attached separately which will be used to detect the player being crushed.) Both rigidbody and character controller are being updated in FixedUpdate()
The problem is, when my controller jumps and the platform is moving towards the controller, the controller partially passes through the platform and I can’t seem to prevent this other than cranking up the skin width which makes me hover above the ground.
Any ideas? How to prevent the character controller passing through?