The Mesh Collider takes a Mesh Asset and builds its Collider based on that mesh. It is far more accurate for collision detection than using primitives for complicated meshes. Mesh Colliders that are marked as Convex can collide with other Mesh Colliders.
Property: | Function: |
---|---|
Is Trigger | If enabled, this Collider is used for triggering events, and is ignored by the physics engine. |
Material | Reference to the Physics Material that determines how this Collider interacts with others. |
Mesh | Reference to the Mesh to use for collisions. |
Smooth Sphere Collisions | When this is enabled, collision mesh normals are smoothed. You should enable this on smooth surfaces eg. rolling terrain without hard edges to make sphere rolling smoother. |
Convex | If enabled, this Mesh Collider will collide with other Mesh Colliders. Convex Mesh Colliders are limited to 255 triangles. |
The Mesh Collider builds its collision representation from the Mesh attached to the GameObject, and reads the properties of the attached Transform to set its position and scale correctly.
Collision meshes use backface culling. If an object collides with a mesh that will be backface culled graphically it will also not collide with it physically.
There are some limitations when using the Mesh Collider. Usually, two Mesh Colliders cannot collide with each other. All Mesh Colliders can collide with any primitive Collider. If your mesh is marked as Convex, then it can collide with other Mesh Colliders.
Note that Mesh Colliders are more computationally expensive than primitive collider types, so it is best to use them sparingly.