Why not mesh collider?

In this lecture, we go through the painful process of a composite collider with 8 capsule colliders. Is there a reason we’re not using a mesh collider, and using the torus mesh we’re given?

A mesh collider only has to be convex if it’s to be a trigger collider, and unless that comes up later, it’s not something we seem to need here. Gameplay testing shows it working as well as the composite collider.

I agree with the sentiment here – this part of the lecture was not explained very well. First of all, using the “composite collider” terminology was confusing, as composite collider is a unity class, but only for 2D objects. Secondly, the torus mesh does work fine when not set to be convex. However, Unity’s mesh collider documentation does help explain the reasoning:

“you can make the shape of the Collider exactly the same as the shape of the visible Mesh for the GameObject, resulting in more precise and authentic collisions. However, this precision comes with a higher processing overhead than collisions involving primitive colliders (such as Sphere, Box, and Capsule) and so it is best to use Mesh Colliders sparingly.”

That would have been good to mention in the lecture. The documentation also states that “Mesh Colliders that do not have Convex enabled are only supported on GameObjects without a Rigidbody component. To apply a Mesh Collider to a Rigidbody component, tick the Convex checkbox.”

So it seems like the intent was to display best practices, but these practices weren’t explained as well as they could have been.

Privacy & Terms