Skip to content

format

typescript
Rigidbody.AddRelativeTorque(torque, mode)

class: Rigidbody

description

Adds a torque to the rigidbody relative to its coordinate system.

This method can be used to apply torque in the local coordinate system of the rigidbody, even if the rigidbody is currently rotated. The torque will be applied according to the local coordinate system of the rigidbody. This allows for easy specification of the direction of the torque in the object's own coordinate system.

parameter

param_nametypedescription
torqueVector3The torque to apply.
modeForceModeThe type of force to apply.

reture

typedescription
void

code example