Yuari
Documentation
Docs/Data types/Vector2.new

Vector2.new

Creates a Vector2.

Syntax

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

Parameters

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

Returns

TypeDescription
Vector2The returned Vector2.

Description

Vector2.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 = Vector2.new(100, 50)
print(v.X, v.Y)

Notes

  • Vector and CFrame operations return new value objects.