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 target

In our shooting gallery, we will need to have something to shoot. In this case, we will need to create a target, which the player can shoot:

  1. Create an empty game object by going to the Hierarchy tab and selecting Create | Empty Game object. Rename that object Target and change its Position to 0, 0,-4 so it'll be on top of other objects.
  2. Add the wooden stick and the duck_outline_brown sprites to the Target object, giving the duck a Position of 0, 1.1,0 to place it on top of the stick.
  3. We want the player to be able to touch the duck so next we will need to add a Polygon Collider 2D component to the duck_outline_brown object:
    Adding a target

Animating ...

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