Objects bouncing and tipping over?

Video - http://www.youtube.com/watch?v=CHED25Uengg

So in the video you can see that the blocks start bouncing and knock each other over. The blocks have identical x coordinates and are perfect squares. So even if they had a bounce of 10 they should bounce perfectly up and down correct? Is there something I’m missing here?

Um, sorry, but not really…

00000066.png

Essentially, because Box2D is a “real world” physics simulator you will not always get the sort of reaction you expect. Especially with multiple bodies being taken into account, their forces will be accumulated and will knock them in unexpected directions.

Sorry about that I I put the video to public now. I thought it was public to begin with.

So is the trick to place the blocks perfectly on top of one another so that there is no bouncing?

It is a combination of things. Try…

Increasing the friction values slightly, to cause the objects to absorb some of their forces.

Setting a linear damping value, to absorb linear motion in general.

Reducing the bounce values to make the blocks less bouncy and stop them propagating so much force against their neighbours.

If you are placing the blocks slightly separated, you might want to increase the damping a lot for the first couple of seconds, while the objects settle.

Thanks for all your help. I’m not sure what was causing it but I tweaked the bounce and the friction a little bit and it’s working perfectly now.

Um, sorry, but not really…

00000066.png

Essentially, because Box2D is a “real world” physics simulator you will not always get the sort of reaction you expect. Especially with multiple bodies being taken into account, their forces will be accumulated and will knock them in unexpected directions.

Sorry about that I I put the video to public now. I thought it was public to begin with.

So is the trick to place the blocks perfectly on top of one another so that there is no bouncing?

It is a combination of things. Try…

Increasing the friction values slightly, to cause the objects to absorb some of their forces.

Setting a linear damping value, to absorb linear motion in general.

Reducing the bounce values to make the blocks less bouncy and stop them propagating so much force against their neighbours.

If you are placing the blocks slightly separated, you might want to increase the damping a lot for the first couple of seconds, while the objects settle.

Thanks for all your help. I’m not sure what was causing it but I tweaked the bounce and the friction a little bit and it’s working perfectly now.