Next, let's add the weapon by performing the following steps so that our player can use it:
From the Hierarchy tab, go to the AdvancedPlayer object and expand it. Expand the FPSCamera object to show all of the weapons that the player can use. From there, click on the
1Pistol
object and press Ctrl + D to duplicate the object (alternatively, use Edit | Duplicate).Move the newly created object below the
4Mace
object and rename it to5CQ Assault Rifle
.If we were to play the game right now, we could press 5 and a second pistol would be displayed. Let's make it so that it will display our new weapon by replacing the weapon that is being rendered in the Vp_FP Weapon (Script) component. The Vp_FP Weapon (Script) component is used to animate a weapon using its procedural motion properties. This means that the component will manipulate the weapon transform's position and rotation using springs, bob, and perlin noise.
With the
5CQ Assault Rifle
object selected in Hierarchy, go to...