Player falling off platforms in 2d running game

Hello.
I’m working on a 2d Platformer game and I have a problem. The player falls of the platforms.

The player uses the character controller to move meaning that the collider is 3D and I’m working in 2D. the ground collider is also 3d and is 1 unit in the Z axis. so it’s wide enough. but when the player runs into crates(that’s he pushes) then sometimes he get’s knocked to the side and falls off.

If it falls off through the z-axis (as I understand from your problem) you can Freeze the Position of your rigidbody along Z-axis so that it will only move in X and Y axis.

According to me, your player is a physical rigidbody which is not Kinematic. So it is reacting back to physical interactions by sliding off. Through inspector window, make your player game object KINEMATIC by checking the box. Hope it Helps :slight_smile: Keep Gaming.

try adding some friction to the platform…thats what i did