O'Reilly logo

Unity 5.x Game Development Blueprints 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

Adding a flashlight

Now that we have a player, we can start creating some custom behaviors for them. Our level currently looks like a dark night, but we still want to give our players the ability to see what's in front of them with a flashlight. We will customize the FPS Controller object to fit our needs:

  1. Create a spotlight by navigating to GameObject | Light | Spotlight. Once created, we are going to make the spotlight a child of the FPSController object's FirstPersonCharacter object by dragging and dropping it on top of it.
    Adding a flashlight
  2. Once this is done, change the Transform Position value to (0, -.95, 0). Because positions are relative to your components ...

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