- Home /
How to increase addTorque spin speed
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);
}
}
Comment
Best Answer
Answer by prototype7 · Feb 20, 2013 at 08:59 AM
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
Your answer

Follow this Question
Related Questions
Calculating Sphere vs. Plane Friction 1 Answer
WheelCollider slowing vehicle down at 0 torque 0 Answers
Physics object slides while turning. 1 Answer
How does unity add torque 1 Answer
Understanding how torque is applied 2 Answers