void ApplyTorque( Vector3 force )

robot_2Generated
code_blocksInput

Description

The ApplyTorque method applies a rotational force (torque) to the PhysicsBody. This method is useful for simulating rotational motion or spinning effects on a physics object.

Usage

To use the ApplyTorque method, call it on an instance of PhysicsBody and pass a Vector3 representing the torque to be applied. The torque vector determines the axis and magnitude of the rotational force.

Example

// Create a new PhysicsBody instance
PhysicsBody myPhysicsBody = new PhysicsBody();

// Define a torque vector
Vector3 torque = new Vector3(0, 10, 0); // Rotates around the Y-axis

// Apply the torque to the physics body
myPhysicsBody.ApplyTorque(torque);