Configure collision mesh decomposition
Decompose collision meshes into approximate convex hulls, or use a single convex collider, during import.
Each <collision> mesh in a URDF file can produce either a single convex MeshCollider or a set of approximate convex hulls generated with the bundled VHACD library. Primitive collision shapes (box, cylinder, sphere) always produce Unity's built-in colliders, regardless of this setting.
Generate approximate convex hulls
To generate approximate convex hulls:
- Select the
.urdfasset in the Project window. - In the Inspector, enable Approximate collisions.
- Select Apply to re-import the asset.
The importer decomposes each <collision> mesh into a set of convex hulls in parallel, using an IJobParallelFor job. Each hull becomes a child GameObject (named hull0, hull1, etc) under the link's collision object, with a convex MeshCollider attached.
To tune the decomposition, adjust the Approximation Settings exposed in the Inspector. The defaults provide sensible results if you don't need to change them.
Use a single convex collider instead
To use a single convex collider instead:
- Select the
.urdfasset in the Project window. - In the Inspector, disable Approximate collisions.
- Select Apply to re-import the asset.
The importer creates a single convex MeshCollider for each <collision> mesh directly, without running VHACD decomposition.