Game Development Reference
In-Depth Information
As we intend to have more than one alarm, make this new creation a
Prefab
by
dragging the
Alarm
GameObject from the project
Hierarchy
to the
Prefabs
folder.
The
Alarm
GameObject should now turn blue in the project hierarchy to
denote it is now a prefab instance.
Now that we have our prefab, create an Empty GameObject in the scene, reset its
position, and name it
Alarms
(this will be our
Alarms
grouping object). Then drag our
current
Alarm
to the
Alarms
GameObject to make it a child, then reset its position.
Next position the
Alarm
in the scene at an appropriate point to trip the hero up
(as shown in the following screenshot). I placed it to the side between the Hero
sphere and the blocks (because I'm evil); additionally, (if you wish) raise it up a bit
on the
Y
axis (say
0.1
) so that it is above the ground plane.
Now one
Alarm
is fun, but four are better, so duplicate the
Alarm
(by navigating to
Edit
|
Duplicate
in the menu or
Ctrl
/
Cmd D
) and move them to other positions in
the scene. Here is a screenshot of what I ended up with (but the final placement is up
to you!):