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

Building an explosive barrel


One of the first things we are going to look at is the common FPS staple: explosive barrels. These will allow the player to get a "leg up" on their enemies by causing explosions when damaged enough. They're also fairly simple to create.

  1. To start off, let's open up the level we created in the Chapter 5, Building Encounters (Chapter 5_5_ HealthPacksPickups.unity in the example files you can get from the Packt Publishing website).

    Let's get the implementation of the functionality to work correctly, then we can make it look nice.

  2. Create an object to represent our barrel. To do this, go to GameObject | 3D Object | Cylinder.

    This will create a 3D object that will look like a cylinder and give it a collider so that it blocks our player if he/she walks into it. It can also be hit by bullets.

  3. Change the object's name to Barrel. The default cylinder is a bit too large to be a barrel, so we will change the Y value of the Scale property to .75. Then, we will position it so that...

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 €14.99/month. Cancel anytime}