AngularVelocity

AngularVelocity : Constraint

Overview

A physics constraint instance used to rotate an Object at a constant angular velocity.

The reference for the angular velocity depends on whether the RelativeTo property is set to World or Attachment.

Properties

AngularVelocity

Vector3

Sets the angular velocity.

Code Samples

local Part = script.Parent
local Attachment = Part.Attachment

local AngularVelocity = Instance.new("AngularVelocity")
AngularVelocity.Attachment0 = Attachment
AngularVelocity.AngularVelocity = Vector3.new(0, 3, 0) 
AngularVelocity.MaxTorque = 1000
AngularVelocity.RelativeTo = Enum.ActuatorRelativeTo.World
AngularVelocity.Parent = Part

MaxTorque

number

Sets the maximum torque (rotational force) allowed during rotation.

Code Samples

local AngularVelocity = script.Parent

AngularVelocity.MaxTorque = 10

ReactionTorqueEnabled

bool

Sets whether a reaction torque is applied when angular velocity is applied.

This property only works when RelativeTo property is set to Attachment1, applying equal and opposite torque to connected Parts when enabled.

Code Samples

RelativeTo

Enum.ActuatorRelativeTo

Sets the reference coordinate system for applying force.

  • World: The angular velocity vector is used as is.

  • Attachment0: The angular velocity vector is transformed relative to Attachment0's CFrame (not recommended).

  • Attachment1: The angular velocity vector is transformed relative to Attachment1's CFrame.

Setting RelativeTo to Attachment0 is possible but may cause abnormal physics behavior, as AngularVelocity is designed to apply torque to Attachment1.

Using Attachment0 as the reference can swap the reference point and force application targets, leading to unexpected rotation, unstable movement, or physics errors like collisions.

Code Samples

local AngularVelocity = script.Parent

AngularVelocity.RelativeTo = Enum.ActuatorRelativeTo.World

Methods

Events

See also

Physics

Last updated