Creating many targets

Now that we have one target working correctly, let's make all of the others using the original as a template:

  1. To start off with, let's make our Target a prefab, so let's do that by going to the Hierarchy tab and then dragging and dropping the object into the Prefabs folder from the Project tab. This will be useful if you later on decide to make changes to all of them. This way, you can just modify the one rather than having to do it over and over again.
  2. We then will need to move our current target to a good spot. Let's go with -5.75, -4.5, and 2.5.

    Note

    I'm doing -2.5 because the front row is at -3 and the middle row is at -2.5, that is, we are going to be placed directly between them. A quick view in 3D will show us that as well:

    Creating many targets
  3. Duplicate that duck and then position the new one's X position to -3.75 (2 units away) and do that four more times for a total of 6 ducks in the row:
    Creating many targets
  4. Create an empty game object with a Position of 0,0,0 and give it a name of Duck Row 3 and then drag and drop our Targets into it.
  5. Duplicate the Duck Row 3 object, rename it to Duck Row 2, and change its Position to 0, 1.75, and 1.
  6. Duplicate Duck Row 2 and rename it to 1 with a position of 0, 3.4, and 2.
  7. Finally, select the Duck Row 2 object and then change the Y Rotation to 180 and Z position to -4 (to make it fit between the two rows taking into consideration the rotation):
    Creating many targets
  8. And with this, save your level and play the game!
    Creating many targets

As you can see, they're all moving and falling correctly!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset