This weeks activity involved creating a top down shooter in Unity.

To start I added assets to the world. First the characters and then the obstacles. I made the objects passive colliders so that the bullets that would eventually be shot wouldn’t go through them.

Then, following the video tutorials, wrote the script that allows the player to move the character and makes the character look where the mouse pointer is in the game world.

I then wrote the code to make the gun shoot bullets when the left mouse button is shot while, still, following the tutorials. I added a new object to the end of the sprites gun and grouped it with the asset so that it could be used as the point at which bullets would spawn.

I then ran into an issue with the code for the enenmy. After troubleshooting and eventually asking for help, it was found that I had missed an equals symbol at the begging of the script. Now knowing this and having fixed the script, I carried on with the project.

After finishing the project, I wanted to make the enemies respawn after being killed. To do this, I went back to the Space Invaders clone that I made last week and adapted the code I used to make enemies respawn in that.


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *