GetAxis problem : object moves up and down as well

Hi, i have a cube and i want it to move left and right, it does just that but when i add a rigidbody (i need the rigidbody so it will fall through gaps and stuff) it moves up and down and rotates as well.

In the rigidbody, just freeze the axes you don’t want to move.