Skip to main content

Vector3::toArray

This function returns an array of the partials of a Vector3.

Syntax​

vector.toArray();

Returns​

  • number[] An array of [x, y, z].

Example​

Server-Side

const vec1 = new mp.Vector3(10, 30, 100);

const array = vec1.toArray(); // [10, 30, 100]