elldo3d
February 20, 2013, 8:18am
1
I add torque to my ball but torque speed doesn’t increase.
I have tried to increase max angular velocity from edit → project settings → physic, but it doesn’t work
This my script
void FixedUpdate()
{
if (Input.GetMouseButtonDown(0))
{
this.rigidbody.AddForceAtPosition(Vector3.right * 1000, transform.position);
this.rigidbody.AddTorque(Vector3.left * 20000);
}
}
You would like to adjust your torque parameter in the inspector while you Play the game,
and to make those things easier add this parameters.
public float angDrag;
public float spinForce;
public float maxAngVel;
void FixedUpdate()
{
rigidbody.angularDrag = angDrag;
rigidbody.maxAngularVelocity = maxAngVel;
rigidbody.AddTorque(0,10 * spinForce,0);
if (Input.GetMouseButtonDown(0))
{
this.rigidbody.AddForceAtPosition(Vector3.right * 1000, transform.position);
//this.rigidbody.AddTorque(Vector3.left * 20000);
}
}
Play the game and adjust angDrag, spinForce, maxAngVel in the inspector