The ApplyTorque
method applies angular velocity to the Rigidbody
component. This method is used to simulate rotational forces on the object, causing it to spin or rotate around its center of mass.
The ApplyTorque
method applies angular velocity to the Rigidbody
component. This method is used to simulate rotational forces on the object, causing it to spin or rotate around its center of mass.
To use the ApplyTorque
method, you need to pass a reference to a Vector3
that represents the torque to be applied. The torque is applied in the world space, affecting the angular velocity of the Rigidbody
.
// Example of applying torque to a Rigidbody Rigidbody myRigidbody = new Rigidbody(); Vector3 torque = new Vector3(0, 10, 0); // Torque to apply myRigidbody.ApplyTorque(ref torque);