If you have worked on high-density physics scenes in Unity, you already know the pain of mesh colliders. Unity’s default PhysX implementation forces us to choose between two extremes: expensive standard MeshCollider components that hog CPU thread cycles during broad-phase collision passes, or auto-generated Convex Mesh Colliders that often round off sharp edges, create floating contact points, and cap out at 255 polygons.
In my experience optimizing mid-core mobile titles and desktop physics sandboxes, high collision overhead is rarely caused by complex physics scripts; it comes down to sloppy collider topology. Boxed Convex Collider addresses this exact bottleneck. It is a dedicated workflow tool designed to analyze complex 3D mesh geometry and automatically approximate the shape using a compound set of oriented BoxCollider primitives or simplified convex hulls.
By replacing heavy mesh calculations with primitive box math, PhysX can execute simple SAT (Separating Axis Theorem) checks instead of complex triangle intersection tests. Here is the key takeaway: switching from unoptimized mesh colliders to a compound box architecture can reduce physics thread allocation by up to 60% without sacrificing visual accuracy for mechanics like raycasting, projectile impacts, or physical interactions.
What sets this tool apart from generic auto-colliders is its underlying spatial decomposition algorithm. Rather than wrapping an entire mesh in a single loose bounding box, it breaks down child meshes based on vertex clustering and surface normals.
Not every mesh needs a complex convex box breakdown, but for specific genres, this tool solves massive performance headaches early in production:
Integrating Boxed Convex Collider into your project pipeline is straightforward. The tool functions as an editor utility, meaning you do not need to leave heavy runtime scripts running in your production builds.
Assets/Tools/BoxedConvexCollider.BoxedConvexColliderBuilder component via the Inspector window.For modular pipelines, you can also trigger collider generation programmatically using editor scripting. Here is an example script demonstrating how to iterate over static environment props and automatically process compound colliders before running a scene build:
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class EnvironmentColliderOptimizer : MonoBehaviour
{
[SerializeField] private float detailPrecision = 0.85f;
[SerializeField] private int maxAllowedBoxes = 8;
[SerializeField] private PhysicsMaterial frictionMaterial;
// Call this method via an Editor Utility or Build Pipeline script
public void OptimizePropColliders()
{
MeshFilter[] filters = GetComponentsInChildren<MeshFilter>();
foreach (MeshFilter filter in filters)
{
// Remove existing unoptimized MeshColliders
MeshCollider oldCollider = filter.GetComponent<MeshCollider>();
if (oldCollider != null)
{
DestroyImmediate(oldCollider);
}
// Bake primitive box child setup
GenerateCompoundBoxBounds(filter.gameObject);
}
}
private void GenerateCompoundBoxBounds(GameObject target)
{
// Example implementation hook referencing the component's generation logic
BoxCollider primaryBox = target.AddComponent<BoxCollider>();
if (frictionMaterial != null)
{
primaryBox.sharedMaterial = frictionMaterial;
}
Debug.Log($"Successfully optimized collision bounds for: {target.name}");
}
}
Honestly, yes, it adds lightweight child GameObjects to your prefab hierarchy to hold individual BoxCollider components. However, from a memory and CPU performance standpoint, handling a dozen primitive box transforms is exponentially cheaper for Unity’s physics engine than processing a single high-poly MeshCollider.
Yes. Once the bake process completes, each generated box is simply a standard Unity BoxCollider component on a child transform. You can assign individual PhysicsMaterial instances, change collision layers, or set specific boxes as triggers independently.
Assets provided through this platform are intended strictly for educational, testing, and evaluation purposes only. They are not cleared for commercial production releases. If you plan to ship a commercial game utilizing this asset, please purchase an official license from the Unity Asset Store to support the original tools developer.