VectorForce
VectorForce : Constraint
Overview
객체에 지속적인 힘과 가속도를 주기 위한 물리 제약(Constraint) 인스턴스입니다.
이 제약은 가속이 계속 누적되기 때문에, 다른 힘이 없으면 엄청 빠르게 움직일 수 있으므로, 속도를 일정하게 유지하고 싶다면 LinearVelocity 제약을 사용하는 것이 유리합니다.
RelativeTo 속성을 World 또는 Attachment 중 어디로 설정하느냐에 따라, 힘이 적용되는 기준이 달라집니다.
Properties
Force
Vector3
힘의 크기와 방향을 설정할 수 있습니다.
Code Samples
local Part = script.Parent
local Attachment = Part.Attachment
local VectorForce = Instance.new("VectorForce")
VectorForce.Attachment0 = Attachment
VectorForce.RelativeTo = Enum.ActuatorRelativeTo.World
VectorForce.Force = Vector3.new(500000, 0, 0)
VectorForce.Parent = Part
RelativeTo
Enum.ActuatorRelativeTo
힘이 적용되는 기준 좌표계를 설정할 수 있습니다.
Code Samples
local VectorForce = script.Parent
VectorForce.RelativeTo = Enum.ActuatorRelativeTo.World
ApplyAtCenterOfMass
bool
힘이 어디에 작용할지를 설정할 수 있습니다.
이 속성을 비활성화하면 힘은 물체의 중심(질량 중심)에 적용됩니다. 반대로 활성화하면 힘은 Attachment0이 있는 위치에 가해지며, 이 위치가 중심이 아닌 경우 회전이 함께 발생할 수 있습니다.
Code Samples
Methods
Events
See also
물리Last updated