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

Using triggers for doors


Earlier, you learned how to use triggers to do something simple, such as spawning enemies to be attacked. In this section, you're going to learn how to use the same principles for doors.

  1. Since we're using the first doorway we created to spawn enemies, let's create our new door in the second one. To do this, open up Prototype and select Create to add a new Cube into the world, placing it in such a way that it fits the front of the doorway we created earlier.

    Tip

    For a refresher on how Prototype works, refer to Chapter 3, Prototyping Levels with Prototype.

  2. Now, switch to the Object mode and press the M key to specify this object as a Mover. To make it easier to tell the difference between the normal stuff and it, select the Vertex Colors option and make the object green.

  3. Next, duplicate the object, click on the Set Trigger button, and drag it out toward both the sides of the door.

  4. To make it easier to look at, rename the trigger to DoorTrigger and the door to Door. Then...

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}