Basic Movement In New Space Shooter Project
Today ill be simply be creating the player with some basics movements and boundaries to establish play space.
we’ll start by creating a new unity 3D project and it Space Shooter (Generic name placeholder). This will be a simple top down galaga-like game.

create a new scene, create a player place holder(Cube) with a position of (0,-2.68,0). Ill also create a material for the player called ,’ Player_Mat’ and place it in its own ‘Material’ Folder

ive seem to have a slight problem. I cant see my cube in the inspector!
It turns out that I have hit the layers tab on the top right and clicked hide,’Everything’. Problem solved.
also worth mentioning that is have my aspect ratio set to 16:9 so we can have this game played on various screen sizes with the same quality.

Creating The Player

Create a new Script called ,’ Player’ and stick it in the scripts folder for organization. This script will then be attached on….you guessed it, the player as this will handle things such as movement.

Ill open that script up and begin populating it with the necessary lines for simple movement.

We simply have our two inputs declared in two float variables that affect the attached objects X and Y’s transform.

along side multiplying an adjustable speed variable since the value of our inputs range from 0–1 in decimals. Meaning that we will only be traveling one meter per seconds, its kinda too slow.
Now all that is done, Its time to create the Boundaries of our play space.
Boundaries

Ive created a method for it which you may have already noticed above in Update(). I like to keep things tidy and I know how confusing my own code can get down the line.
Whats happening here is that im just constraining the Y transform value’s bettween 0 and -3.8F. Since the main camera will remain static throughout the entirety of the game, it would make sense for the player to not go beyond its view in the Y direction (up).
In the X axis(left and right), i have it where the player reappears to the other side of the screen when going beyond the bounds. Creating some kind of scrolling look to it.

and thats it for today, tomorrow I will be messing around with lasers ٩(◕‿◕。)۶.