Vector3Value
Hold a 3D position or direction in the tree.
Value is a Vector3, all zeros by default, and takes only a Vector3. A Vector3 written in the project file is saved exactly as written. Each change fires Changed with the new vector.
Made with Instance.new("Vector3Value") or Clone().
Example
-- A Vector3Value holds a Vector3. Settings.Spawn is one, saved in the project as Vector3(0, 3, 4).
local spawn = root.Settings.Spawn
local at = spawn.Value
print("Spawn: X " .. at.X .. ", Y " .. at.Y .. ", Z " .. at.Z .. ", Magnitude " .. at.Magnitude)
local copy = Instance.new("Vector3Value")
print("a new Vector3Value: X " .. copy.Value.X .. ", Y " .. copy.Value.Y .. ", Z " .. copy.Value.Z)
copy.Changed:Connect(function(point : Vector3)
print("the copy changed, the same point as Spawn: " .. tostring(point == at))
end)
copy.Value = atSpawn: X 0, Y 3, Z 4, Magnitude 5 a new Vector3Value: X 0, Y 0, Z 0 the copy changed, the same point as Spawn: true
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| Value | Vector3 | "Vector3 0, 0, 0" | The vector it holds; each change fires Changed with the new vector, and anything but a Vector3 errors. |
From ShotInstance 33
ClassNameNameParentAncestryChangedAttributeChangedChangedChildAddedChildRemovedDestroyingAddTagClearAllChildrenCloneDestroyFindFirstAncestorFindFirstAncestorOfClassFindFirstAncestorWhichIsAFindFirstChildFindFirstChildOfClassFindFirstChildWhichIsAGetAttributeGetAttributeChangedSignalGetAttributesGetChildrenGetDescendantsGetFullNameGetPropertyChangedSignalGetTagsHasTagIsAIsAncestorOfIsDescendantOfRemoveTagSetAttribute
