O'Reilly logo

Building an FPS Game with Unity by John P. Doran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

    Using triggers for doors
  2. Now, switch to the Object mode and press the M key to specify this object ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required