Posted January 11, 2025 by ForwardSlashGames
I added mobile controls to the game that are intended to work regardless of the device, in the same fashion as one another.
Using Input.GetTouch(int).deltaPosition.normalized I was able to get a value between -1 and 1 depending on the last touchPosition. This gives it a joystick feeling. The ship moves along positions on a rail, so I use this value to move forward and backward along those rails.