Using simpler primitives

Most shapes can be approximated using one of the three primitive colliders. In fact, we do not need to represent the object using only a single collider. We are free to use several colliders if they serve our needs for creating a complex collision shape by attaching additional child GameObjects with their colliders. This is almost always less expensive than using a single Mesh Collider and should be preferred.

The following screenshot shows a handful of complex graphical objects represented by one or more simpler primitive collider shapes:

Using a Mesh Collider for any one of these objects would be significantly more expensive than the primitive colliders shown here due to the number of polygons they contain. It is worth exploring all opportunities to simplify our objects down using these primitives as much as we can, as they can provide significant performance gains.

For example, Concave Mesh Colliders are unique in that they can feature gaps or holes that allow other meshes to fall into or even through them, which introduces opportunities for the objects to fall through the world if such colliders are used for world collision areas. It is often better to place Box Colliders in strategic locations for this purpose.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.67.26