Hello I am currently trying to understand orientation sensors and i have developed a “game” which has an arrow. What I am trying to achieve is to have the arrow move and point towards the direction i am tilting the phone (for example if i tilt the phone left the arrow will point left as it moves towards the left).
**I know ANGLE would be the easiest way to do this, but im just trying to make it move either left or right and up or down (i dont want it to move diagonally or all over the place)
Ive attempted programming this a number of ways but its just not doing what i need it to do. The issue im having currently is that the sprite (arrow) only moves up or down. When the arrow goes up it points left (instead of up) and when the arrow moves down it points right (instead of down). I would very appreciate some help or tips on how to fix this issue. Thank you so much for the help in advance.
Here is the code I have: