Search Unity

Building towers of blocks become unstable

Discussion in '2D' started by Peter Ples, Jan 8, 2014.

  1. Peter Ples

    Peter Ples

    Joined:
    Mar 12, 2013
    Posts:
    237
    I have a bunch of squares with square colliders on them. Just playing with the physics, making structures kind of angry birds style. However, when I build big structures, say 7-10 or more blocks they fall over automatically. I've increased the friction to high levels but still having mostly the same effect.

    Have any of you had experience with this and how have you dealt with combining objects to make structures?
     
  2. Peter Ples

    Peter Ples

    Joined:
    Mar 12, 2013
    Posts:
    237
    Has anyone ever come across this? I still have not found a solution.

    I have been trying to build springs in between them with the idea that if there is too much force, then break the spring. But I can't figure out how to break the spring and it seems like a stupid idea anyway - and very tedious.
     
  3. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    On the RigidBody2D's of the blocks, do you have the Sleeping Mode set to 'Start Asleep'?
     
  4. Peter Ples

    Peter Ples

    Joined:
    Mar 12, 2013
    Posts:
    237
    Yeah, they are all set to Start Asleep. I've attached an image of before playing and about one second after playing. You can't tell in the image, but it slowly sways. I've also been very careful to make sure that the pixels to units are exactly the size of the image and that I placed them on the grid exactly at integers. Also, I've messed with the box colliders changing the x and y to values between .95 and 1.0

    $blocksMessedUp.jpg
     
  5. RedVonix

    RedVonix

    Joined:
    Dec 13, 2011
    Posts:
    422
    This is a shot in the dark, but maybe try setting the Is Kinematic on the blocks' RigidBody2D component to True, then set it to False when the object receives collision or wakes up. If that doesn't work, feel free to send me your project and I'll take a look at it directly.
     
  6. unitylover

    unitylover

    Joined:
    Jul 6, 2013
    Posts:
    346
    What do you have your weight set at for each block?