Making the player move to the right or to the left when the arrow is clicked in Unity
I was working on a script where, if you click the right arrow, the player moves at a constant speed towards the right side of the screen, then stops after leaving the screen. (Similarly, if you click the left arrow, the player moves at a constant speed towards the left side of the screen, then stops after leaving the screen.)