Game Development Reference
In-Depth Information
Step 10: Add colliders to EntryWay. Select the EntryWay prefab in the
Project panel. In the Inspector, under the FBXImporter check the Generate
Colliders option. Click Apply.
Tips and Tricks
Clicking Generate Colliders is a quick and dirty way to make sure that
a mesh is “solid,” meaning the player can't pass through it. However, it
isn't the most efficient method in terms of optimizing for game play. By
clicking this option, every single mesh in the scene has a Mesh Collider,
including the parts of the scene that the player can't even get to. For
instance, are colliders on the beams overhead really necessary if the game
play never calls for getting up to them?
For a PC-based game like this, using Mesh Colliders is acceptable since
there just won't be that much happening at this point in the game.
However, if this were being developed for iOS or Android or even for
distribution on machines that may not be very tough, it would be more
efficient to leave off the Generate Colliders option and instead create
some manual Box Colliders around just the areas that the player would
actually touch.
Step 11: Play the game. Press the Play button in the Toolbar. Using the
standard WASD or Arrow keys, move around the scene using the mouse
to look around ( Figure 5.9 ). Press the Play button again to stop playing
the game.
Figure 5.9 Moving around the scene.
Tips and Tricks
Make sure that the First Person Controller is not halfway through the floor,
or that it is hovering over empty air. Select the First Person Controller
in the Hierarchy panel, and then in the Scene window make sure that it
is just slightly above the ground, so that when the game is played, the
controller will actually be in contact with the floor.
Search WWH ::




Custom Search