Having a working HUD is nice seeing the health bar move when taking damage and putting in multiple hits to enemies before they fall to the ground lifeless being shoved out the way by the rest of the horde of cube bots and having the cube bots find the shortest way around objects towards the player and having the small effects of light flashes going off when shooting at them is enjoyable and would certainly add to the experience if it was polished. Unfortunately, there’s problems with the camera positioning which in future versions or attempts I would like to fix so that it is no longer so close to the character and large that it clips through the bottom of the environment and the player but should be achievable with a few minor tweaks in the unity editor with the positioning. I would also like to add sound effects to the game in future such as background music and gun sounds when shooting maybe even some sounds when taking damage and on death would possible. Of course, I would like to ...
Posts
Showing posts from January, 2018
- Get link
- X
- Other Apps
Then with the player selected in the hierarchy look at the apply button if we click on the apply button what that will do is if we have a prefab the changes we have made to the objects or scripts will update to the prefabs. Now to move onto spawning enemies to start with go to the hierarchy and create empty object and name it enemymanager then create a script name Enemymanager and drag it onto the EnemyManager in the hierarchy now create another empty in the hierarchy and rename it CubeBotSpawnPoint and position it in the scene view to wherever you want the enemies to spawn from. So now if you click on the EnemyManager in the hierarchy you will see some boxes with None in which we don’t want so click and drag the player from the hierarchy onto the player health property in the EnemyManager which will link it to the player health script so that enemies only spawn while the player is alive then there’s another section for enemies so take a cubebot or enemy from either the ...
- Get link
- X
- Other Apps
We then want to make sure the enemy can attack the player so what we do is make a new script named EnemyAttack and drag it onto the enemy named Cubebot as well as making sure the player can harm the enemies or Cubebots to do this create another script named Enemyhealth and drag it onto the enemy or Cubebot to apply the script. Then to make sure that the gun fires in a line I attached a 3D cube that I scaled down to use as a gun and added a particle system component to the cube gun, I then added another component called line renderer which does as it names suggests renders a line expand the materials tab via the dropdown and click on the circle select via the element 0 and is ideal to use a basic line render material which can be gotten from the asset store or other sources, we then want to expand parameters and set start width and end width to 0.05 then disable the line render check box at the top. Now add a new component by going into rendering and selecting light this i...