RigidBody z-axis movement constraint/block not working properly?

I have a simple rigid body character object for a sidescrolling platformer game which moves left and right along the x axis. I have checked the rigidbody constraint box to prevent movement along the z axis, however my character still does so whenever it bumps into any object(particularly spherical ones) and gets thrown off its path. This happens even more often whenever I run the game on my android phone for some reason.

Any ideas on why this happens and if it can be fixed? Thanks in advance :slight_smile:

Just out of curiosity why are you not using unities 2d physics?

This would eliminate this problem you are having but more importantly it would greatly improve performance.