How do i stop my cube sprite from tilting?

I have started a platformer game which is only made up of boxes: my platforms and player.

Both have box collider physics 2D attached to them and my character also has a rigid body 2D.

My character can move and jump smoothly but when my box sprite lands on the edge of a platform its starts to tilt, fall and land on its side.

I’d like to make sure the box does not have any weight so it cannot tilt; it will just stay on the platform evenly , even if leaning off the edge.

I’d appreciate any help, thank you.

In your Rigidbody 2d on the player go to constraints. Check the box next to Freeze Rotation Z