Game Development Reference
In-Depth Information
4. Create two more spheres, scaled down to (
0.4, 0.07, 0.4
). Position
these on the pole to act as mount points for the interactive cloth. The cloth
will attach at these points to the pole. Disable their mesh renderer so that you
cannot see them once they are placed correctly (overlapping the interactive
cloth). Make sure that these two spheres have a rigid body component so
that they can anchor the interactive cloth properly.
5. Create a new, empty
GameObject
, and name it
MissionMgr
. Attach the
MissionMgr
script to this object. We purposely detach this script from the
player because the lifespan of
MissionMgr
may differ from the player ob-
ject.
Now that we have added our flag geometry, let's create some interactive objects to
collect and interact with. As there are 50 states, let's start with Alabama and repeat
the following steps for every other state, modifying the textures and state names as
appropriate:
1. Create a sphere and place it on the ground plane. Name it
Flag-
pole_Alabama
, and disable the mesh renderer component. On the sphere
collider, check the
IsTrigger
checkbox so that we can detect when the player
enters the object.
2. Add a
CustomGameObject
script to this object. Set the display name to
Alabama
and the object type to
flag
.
3. Add a mission token script to this object. Set
id=501
, title to
token
, and the
description to
mission 1 token
.