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

Spawning enemies with the help of a trigger


Enemies are computationally expensive to have spawned throughout the entire game project. A little trick that we use as game developers is spawning enemies right before a player enters an area; this way, they don't need to be created until they're ready to be seen! We can to this through the use of a property called a trigger.

  1. Let's first open the level that we created in Chapter 3, Prototyping Levels with Prototype that we used earlier in this chapter. We will need to add in navigation data to make things easier to work with. Create an empty game object by navigating to GameObject | Create Empty and set Position as 0,0,0. Then, call the game Environment.

  2. Once we have the object created, drag and drop all our cubes and rooms into it as children. After this, click on the Static button to ensure that the objects don't move by selecting Yes, change children. This is an optional step as RAIN can still make a NavMesh without this, but it's a way for...

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}