Game Development Reference
In-Depth Information
Why?
By moving the asset from the Project panel (our library) to the Hierarchy
panel, the prefab First Person Controller has been placed into the game.
Alternatively, this could have been done by dragging the First Person
Controller prefab into the Scene window.
Why?
So why place the First Person Controller now when there is nothing
for it to do? This is a good question and an important part of the
scaling process. The First Person Controller prefab has some important
information such as size. If the First Person Controller instance is
selected in the Hierarchy panel, the Inspector panel will show the
attributes of the instance. Note that the height of the Character
Controller is 2 (meters).
This is important because now there is a guideline object to help us
understand how big the later-placed objects should be. As other assets
are placed in the Unity scene, they will be scaled around the First Person
Controller. Although this may seem counterintuitive—it seems like it
would be easier to scale the controller to fit the scene—this ensures
that the scale of the objects is appropriate for the world scale. This is
particularly critical for functions like physics. If the objects in the scene are
very large or very small, the physics simulations will always appear off.
Step 4: Move the First Person Controller instance to 0,1,0. Select the
First Person Controller instance in the Hierarchy panel. Then in the
Inspector, look to the Transform component and change the Position
X=0, Y=1, Z=0.
Why?
By placing the First Person Controller at 0,1,0 we are placing it at the
world center with the bottom of the controller on the ground (it's 2 units
high with its center at the geometric center so Y=1 puts its bottom on the
“ground”).
Step 5: Center the First Person Controller in the Scene window. Still with
the First Person Controller selected in the Hierarchy panel, press F on the
keyboard. This will center the selected element (First Person Controller) in
the Scene window.
Step 6: Place the EntryWay prefab into the scene. This time, drag the
prefab EntryWay from the Project panel into the Scene window.
Step 7: Place the EntryWay instance at 0,0,0 in the world space. In the
Hierarchy panel, select the EntryWay instance and in the Inspector set the
Position X,Y,Z to 0 ( Figure 5.7 ).
Search WWH ::




Custom Search