Yuari
Documentation
Docs/Data types/Vector3.new

Vector3.new

Creates a Vector3; also callable directly as Vector3(1, 2, 3) and copy-constructs from another Vector3.

Syntax

Vector3.new(x?: any, y?: any, z?: any) -> Vector3

Parameters

ParameterTypeDescription
x?anyThe x value used by the call.
y?anyThe y value used by the call.
z?anyThe z value used by the call.

Returns

TypeDescription
Vector3The returned Vector3.

Description

Vector3.new is part of the Data types library. Vector and CFrame values are VM userdata with operator overloads; operations return new value objects.

Each call creates or returns a fresh object or value that you can store and pass to other functions.

Example

local v = Vector3.new(1, 2, 3)
print(v.X, v.Y, v.Z, v.Magnitude)

Notes

  • Vector and CFrame operations return new value objects.