Collider:setAngularVelocity

Edit

Sets the angular velocity of the Collider.



Sets the angular velocity of the Collider using numbers.

Arguments

NameTypeDescription
vxnumber The x component of the angular velocity.
vynumber The y component of the angular velocity.
vznumber The z component of the angular velocity.

Returns

Nothing

Sets the angular velocity of the Collider using a vector.

Arguments

NameTypeDescription
velocityVec3 The angular velocity of the Collider.

Returns

Nothing

Notes

Although setting the velocity directly is useful sometimes, it can cause problems:

Using forces and impulses to move Colliders will avoid all of these issues.

If the Collider is asleep, setting the angular velocity to a non-zero value will wake it up.

If the Collider has a tag that was marked as static when the World was created, then the Collider can not move and this function will do nothing.

See also