rigidbody make specific side fall first

hello!

how can I make a tree trunk fall to form a bridge ?

I tried to add a rigidbody to the tree trunk and then made the player go into it. It fell down the wrong way (bottom side first) whereas i want top side first.

Either use a Hinge Joint so the bottom of your log won’t move, or fake the falling behavior with your own code. Or maybe even better create an animation and start it when player “pushes” the tree

Hi there,

I have some guesses for you!

So, you have to change the “center of mass” of the object. If you do so, your trunk will be more likely to fall as you want. In Unity 2D you can make this, by script.

GetComponent<Rigidbody2D>().centerOfMass = new Vector2(0.5f, 1);

Note that, centerOfMass will be relative to the object. My guess is to set the center of mass a bit to the right and up, so that you help the trunk to fall in that direction. Don’t go crazy setting the center of mass really high or something, because it will cause some strange behaviour.

Gyazo Working as intended (I think).

My second guess is triggering an animation when the collision occurs. But this will be a bit less realistic i think.

Hope I helped you.