I have a ground with a box collider and built a tower on it. I stacked about 30 bricks using a script. Those bricks have a rigidbody2d and a box collider as well. My question is why is my tower collapsing? The colliders of the bricks first seem to go into each other a little because of the pressure from the bricks above and finally the tower collapses. If I set my bodys to fixed angle the tower is not collapsing but luffing up and down a bit.
Also the Z rotation of my brick is 0 on my prefab, but in the game the bricks rotation are a little different, like 0.005 or something but I guess this is normal because of physics not beeing 100% accurate.
Maybe this video helps a bit to find an answers, this is my tower: http://picpaste.com/pics/tt-new-6ANbkRmo.1415770653.gif
Hi Marcel, with so many people asking questions about this type of thing I thought I would have a quick go myself. Below is a link to the project I made, feel free to download it, have a play with it, and use anything that is of any use to you. The project is in 3D (but you could use an ortho camera perspective to make it look 2D). Control the very basic demolition ball with WASD, move the camera with the mouse(the ball control is not camera dependent so will feel weird if you do)
I sorted out the issue you described by doing two main things :
-
I made the minimum fixed time step 0.01 (twice as often as the default 0.02)
-
I increased the solver iteration count to 30 (default 7)