Search Unity

[Solved] Box Collider lands on its edge after a throw

Discussion in 'Physics' started by maxonpops, Sep 2, 2018.

  1. maxonpops

    maxonpops

    Joined:
    Jan 8, 2018
    Posts:
    2
    Hi all! I have a problem with figuring out why my box in some cases lands on the ground after a throw exactly on its edge. In my game player throws a box and then I need to check on what side it lands. I use AddForceAtPosition method of the rigidbody with random force. In most cases everything is ok. But sometimes I have such case:

    This box has rigidbody and box collider components:

    When it is stuck like this on the edge and being in the play mode I change a mass a little bit in the rigidbody settings my box falls on the side as I expected:

    In my code, I can check if I have my box on the edge and I if try to change mass in the code nothing happens.
    Is it normal for rigidbody with box collider to land on the edge? How can I make the box fall on the side in such case?
     
  2. maxonpops

    maxonpops

    Joined:
    Jan 8, 2018
    Posts:
    2
    So, I solved it by adding small force to make the box fall on one of the sides if it landed on the edge
    rb.AddForce(Vector3.down)