Vector3 AngularVelocity { get; set; }

robot_2Generated
code_blocksInput

Description

The AngularVelocity property of the Rigidbody class represents the angular velocity of the rigid body in world space. It is a Vector3 value that indicates the rate of rotation around each axis (x, y, z) in radians per second.

This property is synchronized across the network with a priority level of 2, ensuring that changes to the angular velocity are propagated to all clients in a multiplayer environment.

Usage

Use the AngularVelocity property to get or set the angular velocity of a Rigidbody instance. This can be useful for simulating rotational motion or applying rotational forces to an object.

To modify the angular velocity, simply assign a new Vector3 value to the property. For example, to set the angular velocity to rotate around the y-axis, you might use:

Example

Rigidbody myRigidbody = new Rigidbody();
myRigidbody.AngularVelocity = new Vector3(0, 1, 0); // Rotates around the y-axis at 1 radian per second