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.
Answer by Zoogyburger · Mar 10, 2016 at 11:48 PM
In your Rigidbody 2d on the player go to constraints. Check the box next to Freeze Rotation Z
There is no check box for constraints or freeze roation
$$anonymous$$ake sure you are not in debug mode by doing this http://docs.unity3d.com/$$anonymous$$anual/InspectorOptions.html. Click on your player. In the inspector, in your Rigidbody 2d expand Constraints and click on Freeze Rotation z.