amazonasebo.blogg.se

Space shooter unity assets
Space shooter unity assets













space shooter unity assets

With all that, we should get something like this: We then take that value and add it to our ship’s current position. Next, in the Update()function, we use Input.GetAxis("Vertical") to get the input values taken from the up and down keys(in our case, the W and S keys) and store the them in the MoveY. We don’t have to use Health for anything at the moment, but we can go ahead and just add it here. We have the variable MoveY for storing the player’s position, and Speed for adjusting the player’s movement speed. Then, add the following: PlayerController Script So let’s create a C# script and call it PlayerController. The player will be able to move up and down across the screen. The next step is to create a script that will allow the player to control the ship. Be sure to disable gravity in the Rigidbody 2D component to keep the ship from falling when the game starts. We can also go ahead and add a Rigidbody 2D and Circe Collider 2D to our ship, since we will need that in the future. Then after downloading and importing it to the project, we create an empty GameObject and call it PlayerShip, and we drag ship1 sprite from the asset pack we just imported and drag it under our new GameObject. The Player Shipįirst, let’s grab a space ship asset from the Unity asset store to use in our game. Our first step will be to create a player ship that can move and fire. Both the player and the enemies will have the ability to shoot, and both can also be killed if their health drops to zero. It will be a simple shooter where the player will take on waves of enemies, and the goal is to survive as long as possible and get the highest score.

#Space shooter unity assets how to

Hello everyone, and welcome to a new devlog series where we will be looking at how to create a 2D space shooter in Unity.















Space shooter unity assets