The collider import and setup in Unity is very simple. The following documentation is a guide on how to get the collisions from Blender to Unity. It will also reference the well-written Unity documentation, for more information on the Physics system in Unity and how the colliders are used by it.

img

Overview

You can find detailed information on the collision setup in Unity in their documentation.

Unity supports the following Collider shapes relevant to this addon:

Note

Convex Colliders are also handled by the Mesh Collider Component. The Mesh Collider has a checkbox to select convex shapes. Convex Mesh Colliders are limited to 255 triangles.

Setup

  1. There are no setup requirements or naming guidelines for exporting colliders to Unity. you can set them up according to your project guidelines or preferences.

    img

  2. Export the asset as fbx, together with all its colliders.

  3. Import the asset to Unity. You can use the same export/import settings as usual.
  4. Drag the asset into the scene. The colliders are visible.

    img

  5. Disable Mesh Renderer for all colliders meshes. Select the colliders from Hierarchy, go to the Inspector and remove the checkbox from the Mesh Renderer

  6. Add Collider Component to the collider mesh. Go to the Inspector -> Add Component -> Box Collider (or whatever collider type you have)

    img

  7. (optional) Is it a dynamic object? If so, add Rigidbody component to the asset parent. To do so, go to Inspector -> Add Component -> Rigidbody

    img

  8. (optional) The collider component has a Physics Matreial input Material that can be used to assign Physics materials to collisons. See: Unity Documentation: Physic Material for more information on physics materials.

    img

Other

img

Warning

It appears that Unity is optimizing all the Convex Mesh Collider geometry even if the triangle max of 255 is not reached. See example above.

The following image shows an example with more complexity. Only the parent contains a Rigidbody component. All colliders in the hierarchy below will function as 1 compound collider. Unity supports multi-edit for all selected entities. You can easily disable Mesh Renderer for all colliders at once and assign the correct collider type based on the naming. In this case, consistent naming comes in handy.

img