Search Unity

AddTorque does not spin object

Discussion in 'Physics' started by wijesijp, Aug 27, 2015.

  1. wijesijp

    wijesijp

    Joined:
    Dec 7, 2012
    Posts:
    11
    I am working on a dice game and my dice is a mesh with Rigid body. It has mass 1 and angular drag 0.05 (all the default values).

    I add torque to the cube following manner;


    Code (CSharp):
    1. rigBody.AddTorque(new Vector3(0.0f, 0, -1000000));
    I expected the cube to spin rapidly but it is doing 1 or 2 rotations before falling to the ground.
    My idea was to use the torque to throw the cube instead of using addforce.

    Any idea how to get the cube to rotate rapidly?
     
  2. HiddenMonk

    HiddenMonk

    Joined:
    Dec 19, 2014
    Posts:
    987
    wijesijp likes this.
  3. wijesijp

    wijesijp

    Joined:
    Dec 7, 2012
    Posts:
    11
  4. wijesijp

    wijesijp

    Joined:
    Dec 7, 2012
    Posts:
    11
    Now the dice are spinning the way I want I am having another problem. Sometimes they get stuck with each other and do not turn to a side. So it not clear sometimes which side has turned up?


    Any ideas on how to fix this?
     
  5. HiddenMonk

    HiddenMonk

    Joined:
    Dec 19, 2014
    Posts:
    987
    Im not sure if I understand what you mean, but would setting your dices rigidbody collision detection to continuous dynamic fix things?
     
    llermy likes this.
  6. wijesijp

    wijesijp

    Joined:
    Dec 7, 2012
    Posts:
    11
    the collisions working fine.
    A dice might lean against another dice and may not fully turn to a side.

    Any ideas on how to prevent this?