24/02/23 - Unity Work
In today's lesson, we were working in Unity Engine again. To begin the lesson, we first had to download some assets into our world documents, to use within the lesson, including a gun, gunshot sound and some grass/rock images. We then had to take the gun asset, and place it into the hierarchy, as a child of our Main Camera. We then had to alter the size and position of this gun, so that it looked like our character is holding it in place. We then had to create a new C# code script for this gun, within our Scripts folder, named Pistol Logic so that we could make it playable. Once we had written out this code, we had to drag it into the Inspector settings of our Gun option. We changed the features of this setting, by changing the Range to be 100, and the Damage to be 10. We also then had to drag in our Main Camera tab into the FPS Camera option, to connect them together. After this, we had to create a target to hit. To do this, we created a cube within the hierarchy, and made it hav...