Sphere collider and box collider

Hi,

I have couple of objects which spin on their axis as well as rotate around another axis. Like our solar system :slight_smile:

I have a wall and want to restrict them inside it. I have mesh collider on that.

If I have box collider on the objects they collide perfectly (both with wall and each other) but after collision they stop pretty quickly and have some wayward behavior.

If I have sphere collider on the objects they collide with wall but not with each other. They last longer though which I prefer.

I am wondering what could be the reason? Is it the interaction surface as sphere would have smaller and box would have larger? Also how I can make them collide better with each other and having them last longer.

By lasting longer I mean they don’t stop spinning soon.

For your objects missing each other, take a look at the green lines around the objects – that’s the collider size. When you add a collider, Unity tries to guess the correct size, but sometimes guesses way too small, so your planets “count” as being tiny and miss a lot. Adjust with the collider component (in Inspector) radius and center. Don’t be afraid to have it be larger than the model, if you want more collisions.

For spinny behavior on crashes, boxes just naturally spin less. If the spheres are too spinny, go to the rigidbody and change AngularDrag (how fast they slow down.) Can also create a physics material, add it to the collider, and use that to adjust bounciness.

Also, if you really need them to work a certain way, it is possible to add a script that does whatever you like (way more work than tweaking settings, but nice to know you aren’t limited to only the settings.)