Game Development Reference
In-Depth Information
4.
Click Apply.
The Avatar icon disappears and, if you check the CornerGarden in the Hierarchy view, you will see
that the Animator component has been removed.
5.
Select each of the other imported assets, and change their Animation Type
to None.
6.
Select the CornerGarden in the Project view once again.
Adding Colliders to Imported Meshes
Switching back to the Model section of the importer, you will notice an option to Generate Colliders
automatically (Figure 4-26 ). This can be useful for quickly checking objects like structures to see how
well a character or First Person Controller can navigate through or around them. The problem is that
automatically-generated colliders are Mesh colliders.
Figure 4-26. The Generate Colliders option in the Importer's Model section
These are the least efficient of the colliders because they use the object's actual mesh as the
collider. Instead of doing a simple distance check for a primitive shape, each face must be tested.
Not only does this take more resources, it will fail if the object has too many tris. Another problem
is that most collision detection is performed with no more than one object having a Mesh Collider.
If they both have Mesh Colliders, one will be dropped back down to something simpler.
With this in mind, let's look at the CornerGarden objects and decide what sort of collider is most
efficient for each. To do that, you will need a bit more information about the game. The character will
not be able to go into the Raised Bed and will never be able to get close enough to a wall to interact
with it. With that information, you might want to put a simple Box collider on everything but the gate.
The game, however, will also have plant-devouring vermin that will be dropped into the scene with
physics, so two pieces (the Raised Bed and the Planter Tower) should have Mesh colliders to allow
 
Search WWH ::




Custom Search