Search Unity

RigidBody and cube stacking

Discussion in 'Editor & General Support' started by kernelkode, Sep 14, 2020.

  1. kernelkode

    kernelkode

    Joined:
    Jan 27, 2014
    Posts:
    19
    I created a simple test scene by stacking instantiated prefab cubes (with rigidbody) into walls. The cubes stacked in an x/y plane start the scene moving and are out of alignment. The cubes stacked in the z/y plane are aligned and not moving. 2019.4.8f1

     
    Last edited: Sep 15, 2020
  2. kernelkode

    kernelkode

    Joined:
    Jan 27, 2014
    Posts:
    19
    I also tried using prefab'd walls. When the wall is rotated to the X axis the boxes move. but put on the Z axis they do not.
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    You should edit the title of your post to have something to do with the actual topic.

    I'll assume you've made completely sure that your colliders are the right dimensions, ideally just using standard unity primitive cubes, ideally set to exactly coordinates rather than manually positioned, with none of the rigidbodies having any constraints enabled.

    In Unity's physics, there's a setting specifically intended to improve the stability of tall stacks of blocks like you have here. I don't know whether this will help or not, but you should try enabling this under the Physics settings to see if it makes a difference:

    upload_2020-9-16_11-40-31.png

    You might also see if changing the Collision Detection mode on the individual rigidbodies makes any difference:

    upload_2020-9-16_11-41-37.png
     
    Joe-Censored likes this.
  4. kernelkode

    kernelkode

    Joined:
    Jan 27, 2014
    Posts:
    19
    Thanks dgoyette! Enabling the Adaptive Force setting helped to mostly fix the issue (just a small amount of misalignment now). It's not a critical scenario for me at the moment, but it is strange how the orientation of the cubes affects the behavior. Thanks for the insight.