Creating Bounds so that the Player stays within the screen

Let's trap the Player in. Day 9
I am moving the Player game object in the Scene view to the edge of the Camera view box. This is how I can see its current position in the inspector.
While moving the player object on the Scene view, we can record the value of its position by looking at the object's transform component. In this case the y position. We can do the same for the x position.
Vertical bounds… ohhhhh yeah!
While moving the player object on the Scene view to the right, we can record the value of its x position.
I am currently committing to the development branch. I then release to the main branch.

--

--

Hello everyone, My name is Gabriel Perez, I am a Unity Developer and a creator who is always learning and experimenting.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gabriel Perez

Hello everyone, My name is Gabriel Perez, I am a Unity Developer and a creator who is always learning and experimenting.