diff --git a/content/en-us/characters/pathfinding.md b/content/en-us/characters/pathfinding.md index 250cf858d..f86558cef 100644 --- a/content/en-us/characters/pathfinding.md +++ b/content/en-us/characters/pathfinding.md @@ -145,7 +145,7 @@ local player = Players.LocalPlayer local character = player.Character local humanoid = character:WaitForChild("Humanoid") -local TEST_DESTINATION = Vector3.new(100, 0, 100) +local TEST_DESTINATION = vector.create(100, 0, 100) local waypoints local nextWaypointIndex @@ -213,7 +213,7 @@ local player = Players.LocalPlayer local character = player.Character local humanoid = character:WaitForChild("Humanoid") -local TEST_DESTINATION = Vector3.new(100, 0, 100) +local TEST_DESTINATION = vector.create(100, 0, 100) local waypoints local nextWaypointIndex @@ -245,7 +245,7 @@ local player = Players.LocalPlayer local character = player.Character local humanoid = character:WaitForChild("Humanoid") -local TEST_DESTINATION = Vector3.new(100, 0, 100) +local TEST_DESTINATION = vector.create(100, 0, 100) local waypoints local nextWaypointIndex @@ -286,7 +286,7 @@ local player = Players.LocalPlayer local character = player.Character local humanoid = character:WaitForChild("Humanoid") -local TEST_DESTINATION = Vector3.new(100, 0, 100) +local TEST_DESTINATION = vector.create(100, 0, 100) local waypoints local nextWaypointIndex @@ -358,7 +358,7 @@ local player = Players.LocalPlayer local character = player.Character local humanoid = character:WaitForChild("Humanoid") -local TEST_DESTINATION = Vector3.new(100, 0, 100) +local TEST_DESTINATION = vector.create(100, 0, 100) local waypoints local nextWaypointIndex @@ -525,7 +525,7 @@ To create a `Class.PathfindingLink` using this example: local character = player.Character local humanoid = character:WaitForChild("Humanoid") - local TEST_DESTINATION = Vector3.new(228.9, 17.8, 292.5) + local TEST_DESTINATION = vector.create(228.9, 17.8, 292.5) local waypoints local nextWaypointIndex diff --git a/content/en-us/chat/examples/proximity-chat.md b/content/en-us/chat/examples/proximity-chat.md index add4a1a6d..04a5418f3 100644 --- a/content/en-us/chat/examples/proximity-chat.md +++ b/content/en-us/chat/examples/proximity-chat.md @@ -28,7 +28,7 @@ local function getPositionFromUserId(userId: number) end -- Return a default position if the player or character cannot be found. - return Vector3.zero + return vector.zero end -- Set the ShouldDeliverCallback for the general channel to control message delivery. diff --git a/content/en-us/education/build-it-play-it-island-of-move/animating-parts.md b/content/en-us/education/build-it-play-it-island-of-move/animating-parts.md index 4d2156433..12362dc20 100644 --- a/content/en-us/education/build-it-play-it-island-of-move/animating-parts.md +++ b/content/en-us/education/build-it-play-it-island-of-move/animating-parts.md @@ -206,7 +206,7 @@ local inTween = false -- Customizable variables local TWEEN_TIME = 1 -local TWEEN_SCALE = Vector3.zero +local TWEEN_SCALE = vector.zero -- Tween variables local tweenInfo = TweenInfo.new( diff --git a/content/en-us/environment/global-wind.md b/content/en-us/environment/global-wind.md index b7badb327..edc28ff30 100644 --- a/content/en-us/environment/global-wind.md +++ b/content/en-us/environment/global-wind.md @@ -50,8 +50,8 @@ local gustCycleDelay = 5 -- Max duration between gust cycles in seconds local gustCycleDuration = 3.5 -- Duration of each gust cycle in seconds -- During each gust cycle, a portion of "gust" will be added to "baseWind" in a ramped fashion -local baseWind = Vector3.new(5, 0, 2) -- Base wind speed and direction -local gust = Vector3.new(25, 0, 10) -- Gust speed and direction +local baseWind = vector.create(5, 0, 2) -- Base wind speed and direction +local gust = vector.create(25, 0, 10) -- Gust speed and direction local gustIntervals = 100 -- Number of iterations used to calculate each gust interval local dg = gustCycleDuration / gustIntervals local dgf = dg / gustCycleDuration diff --git a/content/en-us/luau/native-code-gen.md b/content/en-us/luau/native-code-gen.md index a1a2b699e..f51bee960 100644 --- a/content/en-us/luau/native-code-gen.md +++ b/content/en-us/luau/native-code-gen.md @@ -74,8 +74,8 @@ local function sumComponentsSlow(v) return v.X + v.Y + v.Z end --- "v" is declared to be a Vector3; code specialized for vectors is generated -local function sumComponentsFast(v: Vector3) +-- "v" is declared to be a vector; code specialized for vectors is generated +local function sumComponentsFast(v: vector) return v.X + v.Y + v.Z end ``` diff --git a/content/en-us/luau/tuples.md b/content/en-us/luau/tuples.md index d09f99864..794760be0 100644 --- a/content/en-us/luau/tuples.md +++ b/content/en-us/luau/tuples.md @@ -10,7 +10,7 @@ A **tuple** is a list of values. Many [methods](./functions.md#methods) and [cal If a [method](./functions.md#methods) or [callback](./functions.md#callbacks) accepts a tuple as a parameter, then it accepts multiple values. For example, the API Reference shows that the `Class.BindableFunction:Invoke()` method accepts a "Tuple" as a parameter, so it accepts multiple arguments. ```lua -BindableFunction:Invoke(1, true, "string", Vector3.new(0, 0, 0)) +BindableFunction:Invoke(1, true, "string", vector.zero) ``` ## Returns diff --git a/content/en-us/parts/terrain.md b/content/en-us/parts/terrain.md index a558209e6..c438da480 100644 --- a/content/en-us/parts/terrain.md +++ b/content/en-us/parts/terrain.md @@ -471,7 +471,7 @@ To import a heightmap and optional colormap: You can script terrain generation using the `Class.Terrain` class. For example, to create terrain with grass material that fills a volume, you can use methods such as `Class.Terrain:FillBall()|FillBall()`, `Class.Terrain:FillBlock()|FillBlock()`, `Class.Terrain:FillCylinder()|FillCylinder()`, `Class.Terrain:FillRegion()|FillRegion()`, or `Class.Terrain:FillWedge()|FillWedge()`. ```lua title='Fill Block Volume' -workspace.Terrain:FillBlock(CFrame.new(0, 0, 0), Vector3.new(4, 4, 4), Enum.Material.Grass) +workspace.Terrain:FillBlock(CFrame.new(0, 0, 0), vector.create(4, 4, 4), Enum.Material.Grass) ``` ## Large-Scale Editing diff --git a/content/en-us/production/monetization/engagement-based-payouts.md b/content/en-us/production/monetization/engagement-based-payouts.md index c093b838c..fe96ec22a 100644 --- a/content/en-us/production/monetization/engagement-based-payouts.md +++ b/content/en-us/production/monetization/engagement-based-payouts.md @@ -75,7 +75,7 @@ local Players = game:GetService("Players") local teleporter = script.Parent local showModal = true -local TELEPORT_POSITION = Vector3.new(1200, 200, 60) +local TELEPORT_POSITION = vector.create(1200, 200, 60) -- Teleport character to exclusive area local function teleportPlayer(player) diff --git a/content/en-us/reference/engine/classes/AvatarCreationService.yaml b/content/en-us/reference/engine/classes/AvatarCreationService.yaml index f6601f0a0..4e44011b3 100644 --- a/content/en-us/reference/engine/classes/AvatarCreationService.yaml +++ b/content/en-us/reference/engine/classes/AvatarCreationService.yaml @@ -69,39 +69,39 @@ methods: [Enum.AssetType.DynamicHead] = { ["Bounds"] = { ["Classic"] = { - ["MinSize"]: Vector3, - ["MaxSize"]: Vector3, + ["MinSize"]: vector, + ["MaxSize"]: vector, }, ["ProportionsSlender"] = { - ["MinSize"]: Vector3, - ["MaxSize"]: Vector3, + ["MinSize"]: vector, + ["MaxSize"]: vector, }, ["ProportionsNormal"] = { - ["MinSize"]: Vector3, - ["MaxSize"]: Vector3, + ["MinSize"]: vector, + ["MaxSize"]: vector, }, }, ["SubParts"] = { ["Head"] = { ["NeckRigAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, ["FaceFrontAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, ["HatAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, ["HairAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, ["FaceCenterAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, }, }, @@ -109,51 +109,51 @@ methods: [Enum.AssetType.LeftArm] = { ["Bounds"] = { ["Classic"] = { - ["MinSize"]: Vector3, - ["MaxSize"]: Vector3, + ["MinSize"]: vector, + ["MaxSize"]: vector, }, ["ProportionsSlender"] = { - ["MinSize"]: Vector3, - ["MaxSize"]: Vector3, + ["MinSize"]: vector, + ["MaxSize"]: vector, }, ["ProportionsNormal"] = { - ["MinSize"]: Vector3, - ["MaxSize"]: Vector3, + ["MinSize"]: vector, + ["MaxSize"]: vector, }, }, ["SubParts"] = { ["LeftHand"] = { ["LeftWristRigAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, ["LeftGripAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, }, ["LeftUpperArm"] = { ["LeftShoulderRigAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, ["LeftShoulderAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, ["LeftElbowRigAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, }, ["LeftLowerArm"] = { ["LeftElbowRigAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, ["LeftWristRigAttachment"] = { - ["LowerBound"]: Vector3, - ["UpperBound"]: Vector3, + ["LowerBound"]: vector, + ["UpperBound"]: vector, }, }, }, @@ -164,8 +164,8 @@ methods: [Enum.AssetType.HairAccessory] = { ["Attachments"] = { { - ["Size"]: Vector3, - ["Offset"]: Vector3, + ["Size"]: vector, + ["Offset"]: vector, ["Name"]: string, }, }, diff --git a/content/en-us/reference/engine/classes/BillboardGui.yaml b/content/en-us/reference/engine/classes/BillboardGui.yaml index c8ddadcca..3678a880e 100644 --- a/content/en-us/reference/engine/classes/BillboardGui.yaml +++ b/content/en-us/reference/engine/classes/BillboardGui.yaml @@ -583,4 +583,4 @@ properties: writeCapabilities: [] methods: [] events: [] -callbacks: [] +callbacks: [] \ No newline at end of file diff --git a/content/en-us/reference/engine/classes/BodyAngularVelocity.yaml b/content/en-us/reference/engine/classes/BodyAngularVelocity.yaml index 60bdf09b8..d9f6fc80d 100644 --- a/content/en-us/reference/engine/classes/BodyAngularVelocity.yaml +++ b/content/en-us/reference/engine/classes/BodyAngularVelocity.yaml @@ -37,7 +37,7 @@ properties: second) into the desired [angular velocity][3] (radians per second). For example: Setting `Class.BodyAngularVelocity.AngularVelocity|AngularVelocity` to - `Vector3.new(0, 1, 0) * math.rad(360)` ≈ `Vector3.new(0, 6.283, 0)` will + `vector.create(0, 1, 0) * math.rad(360)` ≈ `vector.create(0, 6.283, 0)` will cause a part to spin around the Y axis once per second. code_samples: type: Vector3 diff --git a/content/en-us/reference/engine/classes/Camera.yaml b/content/en-us/reference/engine/classes/Camera.yaml index e5404304b..858fe0043 100644 --- a/content/en-us/reference/engine/classes/Camera.yaml +++ b/content/en-us/reference/engine/classes/Camera.yaml @@ -65,8 +65,8 @@ properties: The most intuitive way to position and orient the `Class.Camera` is by using the `Datatype.CFrame.lookAt()` constructor. In the following example, the `Class.Camera` is positioned at - `Datatype.Vector3.new(0, 10, 0)` and is oriented to be looking towards - `Datatype.Vector3.new(10, 0, 0)`. + `Datatype.Vector3|vector.create(0, 10, 0)` and is oriented to be looking towards + `Datatype.Vector3|vector.create(10, 0, 0)`. ```lua local Workspace = game:GetService("Workspace") @@ -74,8 +74,8 @@ properties: local camera = Workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable - local pos = Vector3.new(0, 10, 0) - local lookAtPos = Vector3.new(10, 0, 0) + local pos = vector.create(0, 10, 0) + local lookAtPos = vector.create(10, 0, 0) Workspace.CurrentCamera.CFrame = CFrame.lookAt(pos, lookAtPos) ``` @@ -104,7 +104,7 @@ properties: character = player.CharacterAdded:Wait() end - local pos = camera.CFrame * Vector3.new(0, 20, 0) + local pos = camera.CFrame * vector.create(0, 20, 0) local lookAtPos = character.PrimaryPart.Position local targetCFrame = CFrame.lookAt(pos, lookAtPos) @@ -715,8 +715,8 @@ methods: local camera = Workspace.CurrentCamera local castPoints = { - Vector3.new(0, 10, 0), - Vector3.new(0, 15, 0) + vector.create(0, 10, 0), + vector.create(0, 15, 0) } local ignoreList = {} @@ -810,7 +810,7 @@ methods: local function getActualRoll() local camera = workspace.CurrentCamera - local trueUp = Vector3.new(0, 1, 0) + local trueUp = vector.create(0, 1, 0) local cameraUp = camera:GetRenderCFrame().upVector return math.acos(trueUp:Dot(cameraUp)) @@ -1291,7 +1291,7 @@ methods: local camera = Workspace.CurrentCamera - local worldPoint = Vector3.new(0, 10, 0) + local worldPoint = vector.create(0, 10, 0) local vector, onScreen = camera:WorldToScreenPoint(worldPoint) local screenPoint = Vector2.new(vector.X, vector.Y) @@ -1350,7 +1350,7 @@ methods: local camera = Workspace.CurrentCamera - local worldPoint = Vector3.new(0, 10, 0) + local worldPoint = vector.create(0, 10, 0) local vector, onScreen = camera:WorldToViewportPoint(worldPoint) local viewportPoint = Vector2.new(vector.X, vector.Y) diff --git a/content/en-us/reference/engine/classes/EditableMesh.yaml b/content/en-us/reference/engine/classes/EditableMesh.yaml index 602d01613..13653a8c7 100644 --- a/content/en-us/reference/engine/classes/EditableMesh.yaml +++ b/content/en-us/reference/engine/classes/EditableMesh.yaml @@ -115,14 +115,14 @@ description: | local function makeSharpCube() local eMesh = AssetService:CreateEditableMesh() - local v1 = eMesh:AddVertex(Vector3.new(0, 0, 0)) - local v2 = eMesh:AddVertex(Vector3.new(1, 0, 0)) - local v3 = eMesh:AddVertex(Vector3.new(0, 1, 0)) - local v4 = eMesh:AddVertex(Vector3.new(1, 1, 0)) - local v5 = eMesh:AddVertex(Vector3.new(0, 0, 1)) - local v6 = eMesh:AddVertex(Vector3.new(1, 0, 1)) - local v7 = eMesh:AddVertex(Vector3.new(0, 1, 1)) - local v8 = eMesh:AddVertex(Vector3.new(1, 1, 1)) + local v1 = eMesh:AddVertex(vector.create(0, 0, 0)) + local v2 = eMesh:AddVertex(vector.create(1, 0, 0)) + local v3 = eMesh:AddVertex(vector.create(0, 1, 0)) + local v4 = eMesh:AddVertex(vector.create(1, 1, 0)) + local v5 = eMesh:AddVertex(vector.create(0, 0, 1)) + local v6 = eMesh:AddVertex(vector.create(1, 0, 1)) + local v7 = eMesh:AddVertex(vector.create(0, 1, 1)) + local v8 = eMesh:AddVertex(vector.create(1, 1, 1)) addSharpQuad(eMesh, v5, v6, v8, v7) -- Front addSharpQuad(eMesh, v1, v3, v4, v2) -- Back diff --git a/content/en-us/reference/engine/classes/Humanoid.yaml b/content/en-us/reference/engine/classes/Humanoid.yaml index 09cec864d..5cbc72d1c 100644 --- a/content/en-us/reference/engine/classes/Humanoid.yaml +++ b/content/en-us/reference/engine/classes/Humanoid.yaml @@ -1862,7 +1862,7 @@ methods: `Class.Workspace.CurrentCamera|CurrentCamera`. ```lua - humanoid:Move(Vector3.new(0, 0, -1), true) + humanoid:Move(vector.create(0, 0, -1), true) ``` When this function is called, the `Class.Humanoid` will move until the diff --git a/content/en-us/reference/engine/classes/Instance.yaml b/content/en-us/reference/engine/classes/Instance.yaml index 3965885a2..655d91833 100644 --- a/content/en-us/reference/engine/classes/Instance.yaml +++ b/content/en-us/reference/engine/classes/Instance.yaml @@ -1271,11 +1271,11 @@ methods: returned by default. For example, the following code snippet sets the instance's - **InitialPosition** attribute to `Datatype.Vector3|Vector3.new(0, 10, 0)`: + **InitialPosition** attribute to `Datatype.Vector3|vector.create(0, 10, 0)`: ```lua local part = workspace.Part - part:SetAttribute("InitialPosition", Vector3.new(0, 10, 0)) + part:SetAttribute("InitialPosition", vector.create(0, 10, 0)) ``` #### Limitations diff --git a/content/en-us/reference/engine/classes/RayValue.yaml b/content/en-us/reference/engine/classes/RayValue.yaml index 70fb852f9..8ef5260ee 100644 --- a/content/en-us/reference/engine/classes/RayValue.yaml +++ b/content/en-us/reference/engine/classes/RayValue.yaml @@ -12,7 +12,7 @@ description: | to create a new RayValue named "Value" within the `Class.Workspace`. It creates a ray at (0, 50, 0) and it faces in the positive-X direction. - `Instance.new("RayValue").Value = Ray.new(Vector3.new(0, 50, 0), Vector3.new(10, 0, 0))` + `Instance.new("RayValue").Value = Ray.new(vector.create(0, 50, 0), vector.create(10, 0, 0))` Since there is no trivial way to edit rays within Studio, sometimes it is better to use a CFrameValue instead (which can be changed through a part or diff --git a/content/en-us/reference/engine/classes/UserInputService.yaml b/content/en-us/reference/engine/classes/UserInputService.yaml index efae58e00..cdd1d05d7 100644 --- a/content/en-us/reference/engine/classes/UserInputService.yaml +++ b/content/en-us/reference/engine/classes/UserInputService.yaml @@ -316,7 +316,7 @@ properties: When sensitivity is 0, events that track the mouse's movement will still fire but all parameters and properties indicating the change in mouse position will return `Datatype.Vector2|Vector2.new()`, or - `Datatype.Vector3|Vector3.new()` in the case of `Class.InputObject.Delta`. + `Datatype.Vector3|vector.create()` in the case of `Class.InputObject.Delta`. For example, `Class.UserInputService:GetMouseDelta()|GetMouseDelta` will always return (0, 0). code_samples: @@ -817,9 +817,9 @@ methods: The gravity vector is determined by the device's orientation relative to the real-world force of gravity. For instance, if a device is perfectly upright (portrait), the gravity vector is - `Datatype.Vector3|Vector3.new(0, 0, -9.18)`. If the left side of the - device is pointing down, the vector is Vector3.new(9.81, 0, 0). Finally, - if the back of the device is pointing down, the vector is Vector3.new(0, + `Datatype.Vector3|vector.create(0, 0, -9.18)`. If the left side of the + device is pointing down, the vector is vector.create(9.81, 0, 0). Finally, + if the back of the device is pointing down, the vector is vector.create(0, -9.81, 0). This function might be used to enable the user's device to impact or diff --git a/content/en-us/reference/engine/classes/ViewportFrame.yaml b/content/en-us/reference/engine/classes/ViewportFrame.yaml index 851a02cfd..e49814953 100644 --- a/content/en-us/reference/engine/classes/ViewportFrame.yaml +++ b/content/en-us/reference/engine/classes/ViewportFrame.yaml @@ -164,8 +164,8 @@ properties: A `Datatype.Vector3` representing the direction of the light source. description: | A `Datatype.Vector3` representing the direction of the light source from - position `Datatype.Vector3|Vector3.new(0, 0, 0)`. Defaults to - `Datatype.Vector3|Vector3.new(-1, -1, -1)`. + position `Datatype.Vector3|vector.zero`. Defaults to + `Datatype.Vector3|vector.create(-1, -1, -1)`. code_samples: type: Vector3 tags: [] diff --git a/content/en-us/reference/engine/classes/WeldConstraint.yaml b/content/en-us/reference/engine/classes/WeldConstraint.yaml index d41826ee7..875782e49 100644 --- a/content/en-us/reference/engine/classes/WeldConstraint.yaml +++ b/content/en-us/reference/engine/classes/WeldConstraint.yaml @@ -131,10 +131,10 @@ properties: local partA = Instance.new("Part") local partB = Instance.new("Part") - partA.Position = Vector3.new(0, 10, 0) + partA.Position = vector.create(0, 10, 0) partA.Parent = workspace - partB.Position = Vector3.new(0, 10, 10) + partB.Position = vector.create(0, 10, 10) partB.Parent = workspace local weld = Instance.new("WeldConstraint") @@ -174,10 +174,10 @@ properties: local partA = Instance.new("Part") local partB = Instance.new("Part") - partA.Position = Vector3.new(0, 10, 0) + partA.Position = vector.create(0, 10, 0) partA.Parent = workspace - partB.Position = Vector3.new(0, 10, 10) + partB.Position = vector.create(0, 10, 10) partB.Parent = workspace local weld = Instance.new("WeldConstraint") diff --git a/content/en-us/reference/engine/datatypes/Instance.yaml b/content/en-us/reference/engine/datatypes/Instance.yaml index 38a47d6bf..f8739ce16 100644 --- a/content/en-us/reference/engine/datatypes/Instance.yaml +++ b/content/en-us/reference/engine/datatypes/Instance.yaml @@ -24,12 +24,12 @@ constructors: ```lua -- Set new instance's parent last (recommended) local part = Instance.new("Part") - part.Position = Vector3.new(0, 10, 0) + part.Position = vector.create(0, 10, 0) part.Parent = workspace -- Set new instance's parent in constructor (discouraged) local part = Instance.new("Part", workspace) - part.Position = Vector3.new(0, 10, 0) + part.Position = vector.create(0, 10, 0) ```` parameters: - name: className diff --git a/content/en-us/reference/engine/datatypes/PathWaypoint.yaml b/content/en-us/reference/engine/datatypes/PathWaypoint.yaml index 3b883bc40..2e9749a6b 100644 --- a/content/en-us/reference/engine/datatypes/PathWaypoint.yaml +++ b/content/en-us/reference/engine/datatypes/PathWaypoint.yaml @@ -9,11 +9,11 @@ description: | create points along a generated path. The code block below constructs a `Datatype.PathWaypoint` variable with - `Vector3.new(10, 10, 10)` as its position, `Enum.PathWaypointAction.Walk` as + `vector.create(10, 10, 10)` as its position, `Enum.PathWaypointAction.Walk` as its action, and `Custom Label` as its label: ```lua - local pos = Vector3.new(10, 10, 10) + local pos = vector.create(10, 10, 10) local waypoint = PathWaypoint.new(pos, Enum.PathWaypointAction.Walk, "Custom Label") ``` @@ -21,7 +21,7 @@ description: | property will be set to default as empty string. ```lua - local pos = Vector3.new(10, 10, 10) + local pos = vector.create(10, 10, 10) local waypoint = PathWaypoint.new(pos, Enum.PathWaypointAction.Walk) ``` @@ -69,7 +69,7 @@ constructors: parameters: - name: position type: Vector3 - default: Vector3.new(0, 0, 0) + default: vector.zero summary: The 3D position of the waypoint. - name: action type: PathWaypointAction diff --git a/content/en-us/reference/engine/datatypes/Region3int16.yaml b/content/en-us/reference/engine/datatypes/Region3int16.yaml index 09ad6216a..1241a33ea 100644 --- a/content/en-us/reference/engine/datatypes/Region3int16.yaml +++ b/content/en-us/reference/engine/datatypes/Region3int16.yaml @@ -36,8 +36,8 @@ description: | ```lua local function Region3int16toRegion3(region16) return Region3.new( - Vector3.new(region16.Min.X, region16.Min.Y, region16.Min.Z), - Vector3.new(region16.Max.X, region16.Max.Y, region16.Max.Z) + vector.create(region16.Min.X, region16.Min.Y, region16.Min.Z), + vector.create(region16.Max.X, region16.Max.Y, region16.Max.Z) ) end ``` diff --git a/content/en-us/resources/battle-royale/building-system.md b/content/en-us/resources/battle-royale/building-system.md index 4b83d7ab9..9ecb0d80a 100644 --- a/content/en-us/resources/battle-royale/building-system.md +++ b/content/en-us/resources/battle-royale/building-system.md @@ -135,7 +135,7 @@ For example, the **Wall** tile type is expressed as follows: ```lua ObjectTypeConfigurations.Wall = { - ASSET_OFFSET_FROM_CENTER = Vector3.new(0, 0, -CELL_DIMENSIONS.Z / 2), + ASSET_OFFSET_FROM_CENTER = vector.create(0, 0, -CELL_DIMENSIONS.Z / 2), CONNECTIVITY = 0xFF8000, -- 0b 111 111 111 000 000 000 000 000 OCCUPANCY = 0x20, -- 0b 00 00 00 00 1 0 0 0 0 0 } diff --git a/content/en-us/resources/battle-royale/minimap-system.md b/content/en-us/resources/battle-royale/minimap-system.md index 6dd6fa7bf..448fbe59f 100644 --- a/content/en-us/resources/battle-royale/minimap-system.md +++ b/content/en-us/resources/battle-royale/minimap-system.md @@ -62,7 +62,7 @@ To customize the minimap or use the minimap system with your own map and minimap `map_size` - The size of one edge of your map in studs. Note the minimap assumes your map is square and that the map center is located at this world point: `Vector3.new(map_size, 0, map_size`). + The size of one edge of your map in studs. Note the minimap assumes your map is square and that the map center is located at this world point: `vector.create(map_size, 0, map_size)`. `minimap_width` diff --git a/content/en-us/resources/battle-royale/the-storm.md b/content/en-us/resources/battle-royale/the-storm.md index 623c765c4..440da344a 100644 --- a/content/en-us/resources/battle-royale/the-storm.md +++ b/content/en-us/resources/battle-royale/the-storm.md @@ -29,7 +29,7 @@ The default center of the storm is the center of the map, but you can change the ```lua map_size = 2450 * 4, -map_offset = Vector3.new(4900, 0, 4900), +map_offset = vector.create(4900, 0, 4900), ``` ### Storm Options diff --git a/content/en-us/resources/modules/surface-art.md b/content/en-us/resources/modules/surface-art.md index 13293b1ee..ff22ddc74 100644 --- a/content/en-us/resources/modules/surface-art.md +++ b/content/en-us/resources/modules/surface-art.md @@ -158,8 +158,8 @@ local SurfaceArt = require(ReplicatedStorage:WaitForChild("SurfaceArt")) local function createParticleEmitter(canvas, position) local attachment = Instance.new("Attachment") attachment.Position = canvas.CFrame:PointToObjectSpace(position) - attachment.Axis = Vector3.new(0, 0, 1) - attachment.SecondaryAxis = Vector3.new(1, 0, 0) + attachment.Axis = vector.create(0, 0, 1) + attachment.SecondaryAxis = vector.create(1, 0, 0) attachment.Parent = canvas local particleEmitter = Instance.new("ParticleEmitter") diff --git a/content/en-us/resources/the-mystery-of-duvall-drive/developing-a-moving-world.md b/content/en-us/resources/the-mystery-of-duvall-drive/developing-a-moving-world.md index b7e56cf3f..2d1943fc7 100644 --- a/content/en-us/resources/the-mystery-of-duvall-drive/developing-a-moving-world.md +++ b/content/en-us/resources/the-mystery-of-duvall-drive/developing-a-moving-world.md @@ -172,7 +172,7 @@ In addition, we run the sequence to set textures, positions, and brightness, run ```lua beam.Texture = textures[info.textIdx] -beamPart.Position = Vector3.new(info.center.X + og_center.X, og_center.Y, info.center.Y + og_center.Z) +beamPart.Position = vector.create(info.center.X + og_center.X, og_center.Y, info.center.Y + og_center.Z) -- Wipe beam.Brightness = 10 diff --git a/content/en-us/scripting/attributes.md b/content/en-us/scripting/attributes.md index fcc4311f3..cdeabd91e 100644 --- a/content/en-us/scripting/attributes.md +++ b/content/en-us/scripting/attributes.md @@ -77,7 +77,7 @@ Properties are straightforward to access — just use a `.` after the object ref local ReplicatedStorage = game:GetService("ReplicatedStorage") local chair = ReplicatedStorage:WaitForChild("Chair") -chair.LeftArmRest.Size = Vector3.new(10, 1, 10) +chair.LeftArmRest.Size = vector.create(10, 1, 10) ``` ## Creating Attributes diff --git a/content/en-us/scripting/events/remote.md b/content/en-us/scripting/events/remote.md index c0d24a9e1..2049329e5 100644 --- a/content/en-us/scripting/events/remote.md +++ b/content/en-us/scripting/events/remote.md @@ -172,7 +172,7 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage") local remoteEvent = ReplicatedStorage:FindFirstChildOfClass("RemoteEvent") -- Fire the remote event and pass additional arguments -remoteEvent:FireServer(Color3.fromRGB(255, 0, 0), Vector3.new(0, 25, -20)) +remoteEvent:FireServer(Color3.fromRGB(255, 0, 0), vector.create(0, 25, -20)) ``` ### Server → Client @@ -342,7 +342,7 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage") local remoteFunction = ReplicatedStorage:FindFirstChildOfClass("RemoteFunction") -- Pass a color and position when invoking the callback -local newPart = remoteFunction:InvokeServer(Color3.fromRGB(255, 0, 0), Vector3.new(0, 25, -20)) +local newPart = remoteFunction:InvokeServer(Color3.fromRGB(255, 0, 0), vector.create(0, 25, -20)) -- Output the returned part reference print("The server created the requested part:", newPart) diff --git a/content/en-us/scripting/multithreading.md b/content/en-us/scripting/multithreading.md index c84c3ead0..1484ae6af 100644 --- a/content/en-us/scripting/multithreading.md +++ b/content/en-us/scripting/multithreading.md @@ -300,12 +300,12 @@ end -- Bind the callback to be called in parallel execution context actor:BindToMessageParallel("GenerateChunk", function(x, y, z, seed) local voxels = generateVoxelsWithSeed(x, y, z, seed) - local corner = Vector3.new(x * 16, y * 16, z * 16) + local corner = vector.create(x * 16, y * 16, z * 16) -- Currently, WriteVoxels() must be called in the serial phase task.synchronize() workspace.Terrain:WriteVoxels( - Region3.new(corner, corner + Vector3.new(16, 16, 16)), + Region3.new(corner, corner + vector.create(16, 16, 16)), 4, voxels.materials, voxels.occupancy diff --git a/content/en-us/scripting/security/security-tactics.md b/content/en-us/scripting/security/security-tactics.md index 85ed5c0fa..97bc60f03 100644 --- a/content/en-us/scripting/security/security-tactics.md +++ b/content/en-us/scripting/security/security-tactics.md @@ -64,7 +64,7 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage") local remoteFunction = ReplicatedStorage:WaitForChild("RemoteFunctionTest") -- Pass part color and position when invoking the function -local newPart = remoteFunction:InvokeServer(Color3.fromRGB(200, 0, 50), Vector3.new(0, 25, 0)) +local newPart = remoteFunction:InvokeServer(Color3.fromRGB(200, 0, 50), vector.create(0, 25, 0)) if newPart then print("The server created the requested part:", newPart) diff --git a/content/en-us/sound/objects.md b/content/en-us/sound/objects.md index e016f8602..e7eff04c2 100644 --- a/content/en-us/sound/objects.md +++ b/content/en-us/sound/objects.md @@ -202,14 +202,14 @@ local RunService = game:GetService("RunService") local part = Instance.new("Part") part.Anchored = true part.Color = Color3.new(0.75, 0.2, 0.5) -part.Size = Vector3.new(2, 1, 2) +part.Size = vector.create(2, 1, 2) part.Material = Enum.Material.Neon -part.Position = Vector3.new(0, 4, 0) +part.Position = vector.create(0, 4, 0) part.Parent = workspace -- Create an attachment on the part local attachment = Instance.new("Attachment") -attachment.Position = Vector3.new(0, 0.5, 0) +attachment.Position = vector.create(0, 0.5, 0) attachment.Parent = part -- Create a particle emitter on the attachment diff --git a/content/en-us/tutorials/curriculums/gameplay-scripting/detecting-hits.md b/content/en-us/tutorials/curriculums/gameplay-scripting/detecting-hits.md index cf8b2812f..0d8de2e1a 100644 --- a/content/en-us/tutorials/curriculums/gameplay-scripting/detecting-hits.md +++ b/content/en-us/tutorials/curriculums/gameplay-scripting/detecting-hits.md @@ -147,7 +147,7 @@ To prevent cheating, the previous chapter [Implementing Blasters](implementing-b Roblox abstracts away the most involved bits of math, so the result is a short, highly reusable helper function with applicability across a range of experiences: ```lua title="getAngleBetweenDirections" - local function getAngleBetweenDirections(directionA: Vector3, directionB: Vector3) + local function getAngleBetweenDirections(directionA: vector, directionB: vector) local dotProduct = directionA:Dot(directionB) local cosAngle = math.clamp(dotProduct, -1, 1) local angle = math.acos(cosAngle) diff --git a/content/en-us/tutorials/fundamentals/coding-4/nested-loops.md b/content/en-us/tutorials/fundamentals/coding-4/nested-loops.md index 7ef719f97..4517af0e4 100644 --- a/content/en-us/tutorials/fundamentals/coding-4/nested-loops.md +++ b/content/en-us/tutorials/fundamentals/coding-4/nested-loops.md @@ -47,7 +47,7 @@ Nested loops can seem somewhat abstract, so a visual example can help. For this -- Makes a single cube local function createPart() local part = Instance.new("Part") - part.Size = Vector3.new(2, 2, 2) + part.Size = vector.create(2, 2, 2) part.CFrame = CFrame.new(20, 0, 20) part.Color = currentColor part.Parent = workspace @@ -110,7 +110,7 @@ For the cube tower script, first code a function that spawns a single cube. The -- Creates individual cubes local function makeCube() local cube = Instance.new("Part") - cube.Size = Vector3.new(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) + cube.Size = vector.create(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) end ``` @@ -119,7 +119,7 @@ For the cube tower script, first code a function that spawns a single cube. The ```lua local function makeCube() local cube = Instance.new("Part") - cube.Size = Vector3.new(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) + cube.Size = vector.create(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) cube.Color = currentColor end ``` @@ -129,7 +129,7 @@ For the cube tower script, first code a function that spawns a single cube. The ```lua local function makeCube() local cube = Instance.new("Part") - cube.Size = Vector3.new(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) + cube.Size = vector.create(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) cube.Color = currentColor cube.Parent = workspace end @@ -149,7 +149,7 @@ To create a tower, spawn cubes at specific points by setting the X, Y, Z propert -- Creates individual cubes local function makeCube(spawnX, spawnY, spawnZ) local cube = Instance.new("Part") - cube.Size = Vector3.new(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) + cube.Size = vector.create(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) cube.Color = currentColor cube.Parent = workspace end @@ -160,7 +160,7 @@ To create a tower, spawn cubes at specific points by setting the X, Y, Z propert ```lua local function makeCube(spawnX, spawnY, spawnZ) local cube = Instance.new("Part") - cube.Size = Vector3.new(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) + cube.Size = vector.create(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) cube.Color = currentColor cube.CFrame = CFrame.new(spawnX, spawnY, spawnZ) cube.Parent = workspace @@ -278,7 +278,7 @@ local CUBE_SIZE = 2 -- Creates individual cubes local function makeCube(spawnX, spawnY, spawnZ) local cube = Instance.new("Part") - cube.Size = Vector3.new(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) + cube.Size = vector.create(CUBE_SIZE, CUBE_SIZE, CUBE_SIZE) cube.Color = currentColor cube.Transparency = cubeTransparency -- Sets transparency cube.CFrame = CFrame.new(spawnX, spawnY, spawnZ) diff --git a/content/en-us/tutorials/use-case-tutorials/input-and-camera/controlling-the-users-camera.md b/content/en-us/tutorials/use-case-tutorials/input-and-camera/controlling-the-users-camera.md index 497d09c92..93e26be49 100644 --- a/content/en-us/tutorials/use-case-tutorials/input-and-camera/controlling-the-users-camera.md +++ b/content/en-us/tutorials/use-case-tutorials/input-and-camera/controlling-the-users-camera.md @@ -124,7 +124,7 @@ All character models contain a part named **HumanoidRootPart**, which can be use if character then local root = character:FindFirstChild("HumanoidRootPart") if root then - local rootPosition = root.Position + Vector3.new(0, HEIGHT_OFFSET, 0) + local rootPosition = root.Position + vector.create(0, HEIGHT_OFFSET, 0) end end end @@ -150,8 +150,8 @@ local function updateCamera() if character then local root = character:FindFirstChild("HumanoidRootPart") if root then - local rootPosition = root.Position + Vector3.new(0, HEIGHT_OFFSET, 0) - local cameraPosition = Vector3.new(rootPosition.X, rootPosition.Y, CAMERA_DEPTH) + local rootPosition = root.Position + vector.create(0, HEIGHT_OFFSET, 0) + local cameraPosition = vector.create(rootPosition.X, rootPosition.Y, CAMERA_DEPTH) end end end @@ -176,8 +176,8 @@ local function updateCamera() if character then local root = character:FindFirstChild("HumanoidRootPart") if root then - local rootPosition = root.Position + Vector3.new(0, HEIGHT_OFFSET, 0) - local cameraPosition = Vector3.new(rootPosition.X, rootPosition.Y, CAMERA_DEPTH) + local rootPosition = root.Position + vector.create(0, HEIGHT_OFFSET, 0) + local cameraPosition = vector.create(rootPosition.X, rootPosition.Y, CAMERA_DEPTH) camera.CFrame = CFrame.lookAt(cameraPosition, rootPosition) end end @@ -211,8 +211,8 @@ The last step is to run this function repeatedly to keep the camera in sync with if character then local root = character:FindFirstChild("HumanoidRootPart") if root then - local rootPosition = root.Position + Vector3.new(0, HEIGHT_OFFSET, 0) - local cameraPosition = Vector3.new(rootPosition.X, rootPosition.Y, CAMERA_DEPTH) + local rootPosition = root.Position + vector.create(0, HEIGHT_OFFSET, 0) + local cameraPosition = vector.create(rootPosition.X, rootPosition.Y, CAMERA_DEPTH) camera.CFrame = CFrame.lookAt(cameraPosition, rootPosition) end end @@ -241,8 +241,8 @@ The basic structure of getting the user's position and updating the camera's pos if character then local root = character:FindFirstChild("HumanoidRootPart") if root then - local rootPosition = root.Position + Vector3.new(0, HEIGHT_OFFSET, 0) - local cameraPosition = rootPosition + Vector3.new(CAMERA_DEPTH, CAMERA_DEPTH, CAMERA_DEPTH) + local rootPosition = root.Position + vector.create(0, HEIGHT_OFFSET, 0) + local cameraPosition = rootPosition + vector.create(CAMERA_DEPTH, CAMERA_DEPTH, CAMERA_DEPTH) camera.CFrame = CFrame.lookAt(cameraPosition, rootPosition) end end diff --git a/content/en-us/tutorials/use-case-tutorials/physics/creating-moving-objects.md b/content/en-us/tutorials/use-case-tutorials/physics/creating-moving-objects.md index 2f49a8cd2..3a076e54f 100644 --- a/content/en-us/tutorials/use-case-tutorials/physics/creating-moving-objects.md +++ b/content/en-us/tutorials/use-case-tutorials/physics/creating-moving-objects.md @@ -286,7 +286,7 @@ To move an assembly using `Class.BasePart.ApplyImpulse|ApplyImpulse`: local volume = script.Parent local function onTouched(other) - local impulse = Vector3.new(0, 2500, 0) + local impulse = vector.create(0, 2500, 0) local character = other.Parent local humanoid = character:FindFirstChildWhichIsA("Humanoid") if humanoid and other.Name == "LeftFoot" then diff --git a/content/en-us/tutorials/use-case-tutorials/physics/creating-spinning-objects.md b/content/en-us/tutorials/use-case-tutorials/physics/creating-spinning-objects.md index 7a3c04e2f..4f200017a 100644 --- a/content/en-us/tutorials/use-case-tutorials/physics/creating-spinning-objects.md +++ b/content/en-us/tutorials/use-case-tutorials/physics/creating-spinning-objects.md @@ -288,7 +288,7 @@ To spin an assembly using `Class.BasePart.ApplyAngularImpulse|ApplyAngularImpuls ``` lua local part = script.Parent -local impulse = Vector3.new(0, math.random(0, 100), 0) +local impulse = vector.create(0, math.random(0, 100), 0) part:ApplyAngularImpulse(impulse) ``` diff --git a/content/en-us/tutorials/use-case-tutorials/scripting/intermediate-scripting/hit-detection-with-lasers.md b/content/en-us/tutorials/use-case-tutorials/scripting/intermediate-scripting/hit-detection-with-lasers.md index 8a12bcbe8..91ca26a7d 100644 --- a/content/en-us/tutorials/use-case-tutorials/scripting/intermediate-scripting/hit-detection-with-lasers.md +++ b/content/en-us/tutorials/use-case-tutorials/scripting/intermediate-scripting/hit-detection-with-lasers.md @@ -442,7 +442,7 @@ Now that you know where to create a laser beam, you need to add the beam itself. 2. Set the following properties of `laserPart`: - 1. **Size**: Vector3.new(0.2, 0.2, laserDistance) + 1. **Size**: vector.create(0.2, 0.2, laserDistance) 2. **CFrame**: laserCFrame 3. **Anchored**: true 4. **CanCollide**: false @@ -461,7 +461,7 @@ Now that you know where to create a laser beam, you need to add the beam itself. local laserCFrame = CFrame.lookAt(startPosition, endPosition) * CFrame.new(0, 0, -laserDistance / 2) local laserPart = Instance.new("Part") - laserPart.Size = Vector3.new(0.2, 0.2, laserDistance) + laserPart.Size = vector.create(0.2, 0.2, laserDistance) laserPart.CFrame = laserCFrame laserPart.Anchored = true laserPart.CanCollide = false @@ -1063,7 +1063,7 @@ function LaserRenderer.createLaser(toolHandle, endPosition) local laserCFrame = CFrame.lookAt(startPosition, endPosition) * CFrame.new(0, 0, -laserDistance / 2) local laserPart = Instance.new("Part") - laserPart.Size = Vector3.new(0.2, 0.2, laserDistance) + laserPart.Size = vector.create(0.2, 0.2, laserDistance) laserPart.CFrame = laserCFrame laserPart.Anchored = true laserPart.CanCollide = false diff --git a/content/en-us/ui/3D-drag-detectors.md b/content/en-us/ui/3D-drag-detectors.md index 92ef75530..e1ac03307 100644 --- a/content/en-us/ui/3D-drag-detectors.md +++ b/content/en-us/ui/3D-drag-detectors.md @@ -343,7 +343,7 @@ If you set a detector's `Class.DragDetector.DragStyle|DragStyle` to **Scriptable local dragDetector = script.Parent.DragDetector dragDetector.DragStyle = Enum.DragDetectorDragStyle.Scriptable -local cachedHitPoint = Vector3.zero +local cachedHitPoint = vector.zero local cachedHitNormal = Vector3.yAxis local function followTheCursor(cursorRay) @@ -352,7 +352,7 @@ local function followTheCursor(cursorRay) raycastParams.FilterDescendantsInstances = {dragDetector.Parent} raycastParams.FilterType = Enum.RaycastFilterType.Exclude - local hitPoint = Vector3.zero + local hitPoint = vector.zero local hitNormal = Vector3.yAxis local raycastResult = workspace:Raycast(cursorRay.Origin, cursorRay.Direction, raycastParams) @@ -406,7 +406,7 @@ local function snapToWorldGrid(proposedMotion) local roundedX = ((newWorldPosition.X / snapIncrement + 0.5) // 1) * snapIncrement local roundedY = ((newWorldPosition.Y / snapIncrement + 0.5) // 1) * snapIncrement local roundedZ = ((newWorldPosition.Z / snapIncrement + 0.5) // 1) * snapIncrement - local newRoundedWorldPosition = Vector3.new(roundedX, roundedY, roundedZ) + local newRoundedWorldPosition = vector.create(roundedX, roundedY, roundedZ) return proposedMotion.Rotation + (newRoundedWorldPosition - startPartPosition) end @@ -452,8 +452,8 @@ local emitter = script.Parent.EmitterPart.ParticleEmitter local dragDetector = slider.DragDetector dragDetector.ReferenceInstance = originPart -dragDetector.MinDragTranslation = Vector3.zero -dragDetector.MaxDragTranslation = Vector3.new(10, 0, 10) +dragDetector.MinDragTranslation = vector.zero +dragDetector.MaxDragTranslation = vector.create(10, 0, 10) local dragRangeX = dragDetector.MaxDragTranslation.X - dragDetector.MinDragTranslation.X local dragRangeZ = dragDetector.MaxDragTranslation.Z - dragDetector.MinDragTranslation.Z diff --git a/content/en-us/ui/video-frames.md b/content/en-us/ui/video-frames.md index f5718b52f..b1122b584 100644 --- a/content/en-us/ui/video-frames.md +++ b/content/en-us/ui/video-frames.md @@ -65,9 +65,9 @@ If you want to play a video in your experience with code, paste the following co ```lua local screenPart = Instance.new("Part") -screenPart.Size = Vector3.new(16, 9, 1) -screenPart.Position = Vector3.new(0, 8, -20) -screenPart.Orientation = Vector3.new(0, 180, 0) +screenPart.Size = vector.create(16, 9, 1) +screenPart.Position = vector.create(0, 8, -20) +screenPart.Orientation = vector.create(0, 180, 0) screenPart.Anchored = true screenPart.Parent = workspace diff --git a/content/en-us/workspace/cframes.md b/content/en-us/workspace/cframes.md index 3cd3f4684..738d71a7b 100644 --- a/content/en-us/workspace/cframes.md +++ b/content/en-us/workspace/cframes.md @@ -44,7 +44,7 @@ Alternatively, you can provide a new `Datatype.Vector3` position to `Datatype.CF local redBlock = workspace.RedBlock -- Create new CFrame -local newVector3 = Vector3.new(-2, 2, 4) +local newVector3 = vector.create(-2, 2, 4) local newCFrame = CFrame.new(newVector3) -- Overwrite redBlock's current CFrame with new CFrame @@ -85,7 +85,7 @@ local redBlock = workspace.RedBlock local blueCube = workspace.BlueCube -- Create a Vector3 for both the start position and target position -local startPosition = Vector3.new(0, 3, 0) +local startPosition = vector.create(0, 3, 0) local targetPosition = blueCube.Position -- Put the redBlock at 'startPosition' and point its front surface at 'targetPosition' @@ -110,7 +110,7 @@ To offset an object by a specific number of studs from its current position, add ```lua highlight='3' local redBlock = workspace.RedBlock -redBlock.CFrame = CFrame.new(redBlock.Position) + Vector3.new(0, 1.25, 0) +redBlock.CFrame = CFrame.new(redBlock.Position) + vector.create(0, 1.25, 0) ``` @@ -130,7 +130,7 @@ You can use the same technique to offset an object from the position of another local redBlock = workspace.RedBlock local blueCube = workspace.BlueCube -redBlock.CFrame = CFrame.new(blueCube.Position) + Vector3.new(0, 2, 0) +redBlock.CFrame = CFrame.new(blueCube.Position) + vector.create(0, 2, 0) ``` diff --git a/content/en-us/workspace/raycasting.md b/content/en-us/workspace/raycasting.md index 2b1d85e0c..31f6ae6f1 100644 --- a/content/en-us/workspace/raycasting.md +++ b/content/en-us/workspace/raycasting.md @@ -15,8 +15,8 @@ At its most basic level, **raycasting** is the act of sending out an invisible r You can cast a ray with the `Class.WorldRoot:Raycast()` method (`Class.WorldRoot:Raycast()|workspace:Raycast()`) from a `Datatype.Vector3` origin in a `Datatype.Vector3` direction. ```lua title='Basic Raycast' highlight='4' -local rayOrigin = Vector3.new(0, 0, 0) -local rayDirection = Vector3.new(0, -100, 0) +local rayOrigin = vector.zero +local rayDirection = vector.create(0, -100, 0) local raycastResult = workspace:Raycast(rayOrigin, rayDirection) ``` @@ -57,8 +57,8 @@ When casting a ray, the direction parameter should encompass the desired length ```lua title='Raycast Filtering' highlight='4-7,9' -local rayOrigin = Vector3.zero -local rayDirection = Vector3.new(0, -100, 0) +local rayOrigin = vector.zero +local rayDirection = vector.create(0, -100, 0) local raycastParams = RaycastParams.new() raycastParams.FilterDescendantsInstances = {script.Parent} @@ -137,8 +137,8 @@ You can exempt any `Class.BasePart` from hit detection by setting its `Class.Bas ```lua title='Raycast Hit Detection' highlight='7-11' -local rayOrigin = Vector3.zero -local rayDirection = Vector3.new(0, -100, 0) +local rayOrigin = vector.zero +local rayDirection = vector.create(0, -100, 0) local raycastResult = workspace:Raycast(rayOrigin, rayDirection) diff --git a/content/en-us/workspace/streaming.md b/content/en-us/workspace/streaming.md index 5786a8151..ed9e6ef30 100644 --- a/content/en-us/workspace/streaming.md +++ b/content/en-us/workspace/streaming.md @@ -344,7 +344,7 @@ teleportEvent.OnServerEvent:Connect(teleportPlayer) local ReplicatedStorage = game:GetService("ReplicatedStorage") local teleportEvent = ReplicatedStorage:WaitForChild("TeleportEvent") -local teleportTarget = Vector3.new(50, 2, 120) +local teleportTarget = vector.create(50, 2, 120) -- Fire the remote event teleportEvent:FireServer(teleportTarget)