Skip to content

format

typescript
Rigidbody.AddTorque(torque, mode)

class: Rigidbody

description

Add torque to a Rigidbody.

This method can be used to apply torque to a Rigidbody in its world coordinate system. The torque will be applied according to the world coordinate system, regardless of the current rotation of the Rigidbody. This allows for easy specification of the direction of the torque in the world coordinate system.

parameter

param_nametypedescription
torqueVector3The torque to be added.
modeForceModeThe type of torque to apply.

reture

typedescription
void

code example