O'Reilly logo

Unity 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

Creating the shooting behavior

Now, with a traditional first person shooter, we shoot a bullet from a gun to damage enemies. However, we will create a camera that will shoot pictures to damage enemies. To show how easy it is to do, let's get started! Perform the following steps:

  1. The first thing we need to do is go to the FlashlightController object we created earlier. So, with it selected, double-click on it to center the camera on it.
  2. Our camera weapon is going to be another object, which will be a child of the Main Camera object. To do this, first select the Main Camera object that is located on our FlashlightController object and then navigate to GameObject | Create Empty Child. Also, in the Inspector section for this newly created object, confirm ...

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