Ive used this code for moving my object using the directional buttons. But when i testl instead of going back the way it came if eg. travelling left and turn to go right, the object will change direction but also jump up on down the lenght of the object. heres the code:
Sounds like you've got your pivot point at the wrong place... which means that when you change the rotation from 0 to 180, it will also seemingly displace for it's full length.
Simple solution: place the pivot at the center of the object. Hard solution: check if the rotation is not what it should be (eg. it's 0 when it should be 180) and if that is so, add an extra amount equal to the object's width.