I’m pretty new to Unity and I’m sorry if it’s a already covered question
So I have modeled a simple object in Cinema4d (a traffic cone) and I want to be able to pile up a number of this object on Unity
This is my Cinema4d model :
I simply drag and drop the c4d file into Unity, don’t forget to hit the “generate colliders” checkbox on my object and add 2 on my scene
In order to pile these up I added a Rigid Body on my objects and a Mesh Colliders on each element on my object (as read on the net)
I check the Convex checkbox (again as read on the net) and I ended with this :
As you can imagine my traffic cones don’t pile up at all, there are 2 Mesh Colliders (in green, on on the actual cones and one traversing the bases) which block the pile up
How can I fix this in C4D or Unity ?
I’m forgetting something here, how do you pile up concave objects in Unity ?
Thanks for your answers
EDIT(after Kryptos answers) :
The best approach so far is with coumpound colliders (look at my answer) but I got weird behaviour
Don’t generate convex mesh, there are expensive and will look (and behave) strange because of the way the convex hull is generated.
In your case, you should use a BoxCollider or a CapsuleCollider (or a compound with a thin BoxCollider at the bottom and a CapsuleCollider on top of it). It will be less expensive and more predictable.
edit (after your comment):
In that case, convex collider can’t do. The hole makes the collider concave.
You can try to achieve it by playing with combination of BoxColliders (3, 4 or more) and a SphereCollider at the top.
Another solution would be to keep a concave collider by using a low-poly version of your cone and assigning this low-poly version to the mesh property of the MeshCollider. But concave colliders do have limitation regarding the physics simulation. And in your case the limitation would break what you want to achieve: concave colliders cannot collide with each other.
I applyed your solution (coumpound colliders) :
The cone pile up but sometimes with weird behaviour (bouncing, passing through others colliders)
Usually the process would be creating a compound collider by hand, but in this case I’m afraid the object is quite hard to decompose manually into primitive colliders.
We just developed a component for Unity3D that can help you with the problem you are facing (and maybe face in the future):
It is available at the Unity3D Asset Store: