Creating the weapon

Next, let's add the weapon by performing the following steps so that our player can use it:

  1. 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).
  2. Move the newly created object below the 4Mace object and rename it to 5CQ Assault Rifle.
    Creating the weapon

    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 ...

Get Building an FPS Game with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.