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 ...

Get Unity 5: Learning C# by Developing Games now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.