# Unity - How do I make non-convex Meshes collide with physics?

Whenever I add a Rigidbody component to an object with a non-Convex Mesh, Unity throws this error:

Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5. If you want to use a non-convex mesh either make the Rigidbody kinematic or remove the Rigidbody component. Scene hierarchy path "Ship/BlockHolder/MeshHolder [0]", Mesh asset path "" Mesh name "MeshHolderTemplate(Clone)"

https://docs.unity3d.com/Manual/class-MeshCollider.html

After doing some research, it appears that I need to either enable the "Convex" setting for the Mesh Collider (which is NOT what I want - my objects require concavity)

or enable the "Is Kinematic" option for the Rigidbody component (which is NOT what I want either - from what I can see, Kinematic objects cannot be pushed by other objects)

The end goal is this: https://www.youtube.com/watch?v=O_UXKce9-OY&t=41s

(I can add the destruction later, for now, I just want the objects to be able to move and not intersect with each other)

How do I do this? I am completely lost here. Is this impossible in Unity?

• Have you tried using a collection of BoxColliders instead? Aug 25, 2017 at 18:45
• On an object that could potentially have tens of thousands of voxels, wouldn't that be too laggy? Aug 25, 2017 at 18:49
• You expect tens of thousands of individual triangle checks against every face of a mesh to be faster? ;) With both you'd naturally do everything you can to eliminate redundant collision data, like spanning long flat areas with a single collider instead of subdividing it for every constituent voxel. But there's a certain minimal complexity you've already committed to by using a 10000+ voxel shape in the first place and requiring its collision to honour concavity. Not much you can do to escape that, though you can break it down into smaller chunks to work with at a time. Aug 25, 2017 at 18:55
• If I were to use BoxColliders, is there a well-optimized algorithm for merging BoxColliders? (A line would become a single long BoxCollider) Aug 25, 2017 at 19:15
• Here's some related questions: gamedev.stackexchange.com/questions/109687 gamedev.stackexchange.com/questions/129648 gamedev.stackexchange.com/questions/125927 You'll need to figure out how to add a dimension to the algorithms :)
– House
Aug 25, 2017 at 19:48

I found this script which builds "compound colliders" out of BoxCollider colliders. These colliders allow me to use a non-Kinematic Rigidbody on my voxel objects.