Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Building an FPS Game with Unity

You're reading from  Building an FPS Game with Unity

Product type Book
Published in Oct 2015
Publisher
ISBN-13 9781782174806
Pages 326 pages
Edition 1st Edition
Languages

Table of Contents (18) Chapters

Building an FPS Game with Unity
Credits
Foreword
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started on an FPS 2. Building Custom Weapons 3. Prototyping Levels with Prototype 4. Creating Exterior Environments 5. Building Encounters 6. Breathing Life into Levels 7. Adding Polish with ProBuilder 8. Creating a Custom GUI 9. Finalizing Our Project Index

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.

    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.

  3. With the 5CQ Assault Rifle object selected in Hierarchy, go to...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}