AngularVelocity

AngularVelocity : Constraint

Overview

객체를 일정한 각속도로 회전시키기 위한 물리 제약(Constraint) 인스턴스입니다.

RelativeTo 속성을 World 또는 Attachment 중 어디로 설정하느냐에 따라, 각속도가 적용되는 기준이 달라집니다.

Properties

AngularVelocity

Vector3

각속도를 설정할 수 있습니다.

Code Samples

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

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

MaxTorque

number

회전 운동 시 허용되는 최대 토크(회전력)를 설정할 수 있습니다.

Code Samples

local AngularVelocity = script.Parent

AngularVelocity.MaxTorque = 10

ReactionTorqueEnabled

bool

각속도가 적용될 때, 그에 대한 반작용 토크를 함께 적용할지 설정할 수 있습니다.

이 속성은 RelativeTo 속성이 Attachment1으로 설정되었을 때만 동작하며, 속성을 활성화하면 연결된 두 파트에 같은 크기이면서 반대 방향의 회전력(토크)을 적용하게 됩니다.

Code Samples

RelativeTo

Enum.ActuatorRelativeTo

힘이 적용되는 기준 좌표계를 설정할 수 있습니다.

  • World: 각속도 벡터가 그대로 사용됩니다.

  • Attachment0: Attachment0의 CFrame을 기준으로 각속도 벡터가 변환되어 적용됩니다. (비권장)

  • Attachment1: Attachment1의 CFrame을 기준으로 각속도 벡터가 변환되어 적용됩니다.

RelativeTo를 Attachment0으로 설정할 수는 있지만, 이 경우 비정상적인 물리 동작이 발생할 수 있습니다. 이는 AngularVelocity 제약이 기본적으로 Attachment1에 회전력을 적용하도록 설계되어 있기 때문입니다.

Attachment0을 기준으로 회전 방향을 계산하면 기준점과 힘의 적용 대상이 뒤바뀌어, 예상치 못한 회전 방향, 불안정한 움직임, 또는 충돌과 같은 물리 오류가 발생할 수 있습니다.

Code Samples

local AngularVelocity = script.Parent

AngularVelocity.RelativeTo = Enum.ActuatorRelativeTo.World

Methods

Events

See also

물리

Last updated