Vector3

A 3D vector: a position, a direction or a size.

Add, subtract and scale it, take dot and cross products, and read its length.

Constructors

Up and coming: the native runtime gives these. Today a program reads a Vector3 from an attribute or a Vector3Value, and shot check refuses Vector3.new in a System project.

NameArgumentsReturnsDescription
Vector3.new(x: number?, y: number?, z: number?)Vector3

Constants

NameTypeDescription
Vector3.zeroVector3
Vector3.oneVector3

Properties

NameTypeDefaultDescription
Magnitudenumber
UnitVector3
Xnumber
Ynumber
Znumber

Methods

NameArgumentsReturnsDescription
Abs()Vector3
Angle(other: Vector3, axis: Vector3?)number
Ceil()Vector3
Cross(other: Vector3)Vector3
Dot(other: Vector3)number
Floor()Vector3
FuzzyEq(other: Vector3, epsilon: number?)boolean
Lerp(goal: Vector3, alpha: number)Vector3
Max(...: Vector3)Vector3
Min(...: Vector3)Vector3
Sign()Vector3

Operators