Datatype · Userdata

Vector2

userdatasince 0.9.1-dev

A two-dimensional vector, typically used for screen coordinates and 2D sizes.

Properties

4
NameTypeAccessDescription
Xnumberread
since 0.9.1-devRoblox ↗
Ynumberread
since 0.9.1-devRoblox ↗
Magnitudenumberread

Length of the vector.

UnitVector2read

Normalized copy of the vector (length 1).

Methods

11

#Vector2:Angle(other: Vector2, isSigned: boolean) → number

Angle in radians between this vector and other. If isSigned, range is [-pi, pi]; else [0, pi].

Parameters

otherVector2
isSignedboolean

#Vector2:Max(other: Vector2) → Vector2

Component-wise maximum of this vector and other. Note: unlike Roblox, only one argument is supported.

Parameters

otherVector2

#Vector2:Min(other: Vector2) → Vector2

Component-wise minimum of this vector and other. Note: unlike Roblox, only one argument is supported.

Parameters

otherVector2

#Vector2:FuzzyEq(other: Vector2, epsilon: number) → boolean

True if both components are within epsilon of other.

Parameters

otherVector2
epsilonnumber