Keeping the Player on the Screen

In this article, we will make it so the Player will not go off the screen by putting limits on how far the Player can move away from the starting position.

Example of Final Goal
Making the Upper Y Limit
Upper Y Limit
Up and Down Limits Working
Cleaning Up the Y Limit
Code to Wrap Horizontal Movement
Wrapping Horizontal Movement
Movement Code in Function

Unity Developer, Software Engineer, Game Developer