Skip to content

Vect2

Represents a 2 component luau vector.

There is an optional coord parameter representing each coordinate (x, y) which defaults to f32. It is worth noting that an f64 Datatype's precision won't apply here, so f32 is always better for vectors.

function light.datatypes.vect2

Shared Synchronous
1
2
3
function vect2(
    coord: Datatype<number>?
): Datatype<vector>

The coord parameter defines how each coordinate of [light.vect2()] will be encoded. If left unselected, it will choose float32 by default. Luau cannot represent floats beyond f32 in a vector, so using a f64 for this would be wasteful.