- Home /
Stack/Tower of inelastic collider2D + rigidbody2D bounce when collide with ground, single collider2D + rigidbody2D does not bounce
I have a bunch of objects stacked on top of each other in my 2D game (13 objects to be precise). Each object has an identical boxcollider2D and rigidbody2D. When I drop this stack of objects and it collides with the ground (a 2D boxcollider and rigidbody2D), the stack behaves like a spring. The boxcollider2D's overlap and the stack compresses. It takes some time (0.4-1s) for this compressed stack to fully return to its normal height (without any overlap between the individual boxcollider2Ds). I want the falling stack to collide inelastically with each other and with the ground eliminating this spring behavior.
I tested a lot of things to try to achieve this:
Adding a PhysicsMaterial2D with 0 bounciness to the ground and the objects: no help
Changing the Default Contact Offset: no help
Changing the Bounce threshold: no help
Increasing Baumgarte Scale: This helped but did not resolve the issue
Adding drag/changing gravity and mass: really high drag fixes this but is not an option for me
Collision Detection (Discrete => Cts): this caused jitter
After some testing, I found that if I only drop one item or two items, this elastic behavior is eliminated and the collision is nearly inelastic like I want.
My ultimate solution was to write a script that uses a single boxcollider2D to determine the path of the stack/tower but I want to know if there was a better solution because this behavior while functional is not exactly what I want either.
Thank you.
Answer by matthewroxby · May 26, 2021 at 10:52 AM
Have you tried altering the edge radius of your box objects?
I hadn't but I have now. That doesn't fix the issue but it does improve it a bit. There is still a lot of bounce to the stacks when I do this.