- Home /
Character controller partially passing through rigidbody in a head on collision
This is a follow up question to something I asked yesterday and I thought I should put it in it's own question.
I have a character controller and a platform, which is a kinematic rigidbody.
The rigidbody just oscillates between 2 points, and moves with:
rigidbody.MovePosition(rigidbody.position + _direction*Speed*Time.deltaTime);
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.
The controller is using a modified version of the standard fpswalker script (to allow things like wall jumping etc) but I do not believe any modifications would have changed the behavior in these circumstances.
A video of the problem can be found here: http://bovinelabs.com/crush/crush/
Suggestions?
Answer by tertle · Feb 22, 2011 at 08:19 AM
Managed to work around well enough that it works near flawlessly.
Greatly reduced the Time.fixedDeltaTime and added a larger buffer zone to my crushing objects.
Answer by Velketor · Mar 14, 2011 at 03:11 AM
You can also add more than 1 mesh to collide. Sometimes doubling or tripling up the mesh's can ensure they always collide, even at high speeds.
I hope this helps.
Shawn