CFrameValue

사용되지 않는 항목 표시

A container object for a single CFrame value.

코드 샘플

Store the Camera's CFrame

-- Create a CFrame that stores the camera's current position/orientation
local vSnapshot = Instance.new("CFrameValue")
vSnapshot.Value = workspace.CurrentCamera.CFrame
vSnapshot.Name = "Snapshot"
vSnapshot.Parent = workspace
-- Later, we can load the CFrame back into the camera
workspace.CurrentCamera.CFrame = vSnapshot.Value

속성

Value

병렬 읽기

Used to hold a CFrame value.

메서드

이벤트

Changed

Fired whenever the CFrameValue.Value of the CFrameValue is changed. It will run with the new value being stored in the argument object, instead of a string representing the property being changed.

This event, like other changed events, can be used to track when an CFrameValue changes and to track the different values that it may change to.

For instance, this even may be useful in games that rely on CFrameValues to track game object CFrame positions and movements.

Equivalent changed events exist for similar objects, such as NumberValue and StringValue, depending on what object type best suits the need.

매개 변수

value: CFrame

The new value after the change.


코드 샘플

CFrameValue.Changed

local cframeValue = script.Parent.CFrameValue
cframeValue.Changed:Connect(print)
cframeValue.Value = CFrame.new(1, 2, 3)