Fast Objects Moving Through Walls [Solved]

I’ve been working at this issue for a long time now, and none of the solutions I’m seeing online are fixing it. I’m using Unity Terrain and the mesh has some mountain-like areas, which the player will move right through if running.

My movement is done in the FixedUpdate method using RigidBody.MovePosition. I’ve tried switching my Rigidbody to Continuous, and using the script Don’t Go Through Things, but neither solution seems to work for me. Decreasing FixedTimeStep seems to fix the problem somewhat, but only up to a certain speed, and I’d rather not decrease the value too much.

Have you considered moving your character by applying forces or setting the Rigidbody’s velocity, instead of directly moving it with MovePosition?

1 Like

I had originally avoided the idea, because I couldn’t figure out how to get AddForce to work, but it did end up fixing my clipping problem! (I also still needed to have the Continuous setting applied to my Rigidbody for a lot of the real high speed collisions)

For anyone looking for a decent example of how AddForce can be used to simulate a similar kind of motion as MovePosition does, looking at this script helped me a good amount.