rigidbody2d and circelcollider2d stacking shake

I am making a game in which fruits fall due to physical gravity. Fruits of the same type will be synthesized into new fruits after collision. However, during the production process, I found that when the fruits are stacked very high in the scene, the fruits will shake and rotate. , what’s going on?
I used the UGUI Image to bind the rigidbody2d and circelcollider2d components, and used Continuous and Interpolate, but I still have this problem.
59FO6kjCIFbRt5nYff

In the end, the solver is doing its best to keep things stable however doing things such as having stacks of masses beyond the 10:1 ratio and not increasing the solver iterations beyond the defaults when things get complex can make this hard to solve for it. Also, critically, you should not be doing any work on the Transforms at all if you want to allow physics to solve things without interruption. Finally, adding in restitution (bounce) can make forces amplify throughout the stacks so presumably here you’ve got that set to zero. Also super high friction can do the same.

That said, 2D physics (Box2D) is very stable. Here’s an older video where a bunch of Rigidbody2D/CircleCollider2D using continuous are just dropped on each other. They all have the same mass but I recall increasing the solver iterations as it’s not a simple solver situation:

1 Like

thank you for your reply
Yes, the Friction setting in my PhysicsMaterial is 0.1, and the Bounciness setting is 0 (because I don’t want to bounce). Now I have changed it to 1 and 0.1. This problem does not seem to occur again. Thanks again.

A little confused by your reply. You’re saying you set the Friction=1 and Bounce=0.1 and it has gone away? I’m not sure I understand why. Increasing the bounce should not solve that although I could understand how increasing friction slightly might for a specific case.

I am assuming of course that the 2D physics settings are at default and you’re also running the simulation during the FixedUpdate.

I guess either way, as long as you’re happy with it even if I don’t follow how that would solve it. :slight_smile:

1 Like