# How to prevent Rigidbodies with restricted movement from clipping

My player is a rigidbody cube with a box collider that can push other "NPC" rigidbody cubes that also have a box collider. These NPC cubes have restricted movement either in horizontal or vertical direction. If the player pushes a cube that can only move horizontally into a cube that can only move vertically, the cubes start clipping. I recorded the whole situation in this video. Note that the NPC cube on the left has frozen X position, while the one on the right has frozen Z position.

I know that one way of preventing this would be to increase the mass of the NPC cubes, but that would only resolve the problem proportionally to the increased mass (the higher the mass, the lower the clipping), and at some point my player is not strong enough to move the NPC cubes anymore.

How can I solve this?

• How are you moving the objects? The only physically correct way is to apply impulses and forces. – Shadows In Rain Apr 29 at 5:34
• I'm moving them by changing their velocity as rigidbodyComponent.velocity = new Vector3(horizontalInput * moveSpeed, rigidbodyComponent.velocity.y, verticalInput * moveSpeed); – Liisjak Apr 29 at 14:45
• In the video, the red block pushes the middle block, and the middle block clips through the left block. To be clear, what you want is to prevent the middle block from clipping into the left block? – Kevin Apr 29 at 20:51
• Have you tried playing around with the Solver Iterations / Solver Type in the project Physics Settings? – Kevin Apr 29 at 20:56
• Yes, I want to prevent the middle block from clipping into the left block. Changing the Solver Iterations and/or Solver Type did not affect the behaviour. – Liisjak Apr 30 at 19:55