Game Development Reference
In-Depth Information
Figure 2-5. Moving the autocreated material to the Materials folder
Caution Items deleted from a Unity project are sent directly to the Recycle Bin on Windows, or the Trash
on Mac. So if you accidentally delete something from your project, you can easily restore it again. Unless you
empty the Recycle Bin or Trash!
Secondly, imported meshes lack collision information by default. This means that Charatcer Controllers,
such as the Third and First Person Controllers, will simply walk through the meshes in the scene, rather
than collide with them, as you'll often want them to do. There are several solutions for fixing this. One
way is to generate mesh colliders , and the other is to manually surround the meshes (when added to a
scene) with basic collision primitives, like box and sphere colliders, which can be added to any game
object from the main menu under Component Physics . For the first method, select all meshes in
the Project panel and then enable Generate Colliders from the Object Inspector, being sure to click
the Apply button afterward to confirm the setting change (see Figure 2-6 ). Doing this autogenerates
a mesh collider component (with appropriate collision data based on mesh geometry) and attaches it
to the mesh. This collision data typically produces accurate results, leading to high-quality collisions.
But for complex meshes (with lots of vertices) it can turn out computationally expensive, leading to
performance issues—especially on mobile devices. Consequently, the second method is often a
preferred alternative. But our game (with its low-poly meshes) may safely use the first method.
 
Search WWH ::




Custom Search