With the introduction of the new Vector library, which offers significantly better performance due to being fully implemented in Luau, it’s great to see alternatives to Vector3 such as Vector.zero and Vector.one.
However, one commonly used and useful part of Vector3 that is missing from the new library is the inclusion of directional constants like Vector3.xAxis, Vector3.yAxis, and Vector3.zAxis.
It would be very helpful if the new Vector library included equivalent constants, such as vector.xAxis, vector.yAxis, and vector.zAxis, for clarity and convenience when working with direction-based operations.
I’d also like to take this opportunity to respark discussion regarding other unit vectors ((1, 1, 0), (1, 0, 1), (0, 1, 1)).
They’re mostlycommon, almost exclusively used for masking, and it just seems odd to not have them. I know the compiler does a good job at inlining, but it’d be nice for ergonomics.
Little bikeshedding here, but the names should be vector.xaxis and etc. to better fit Lua’s casing standards.
I personally don’t see how this would work. Isn’t the new vector library n-dimensional? Thus you could have vectors without a y or z component, or vectors with arbitrary numbers of components, and we can’t have aAxis bAxis cAxis dAxis eAxis fAxis gAxis etc for a 24 component vector.
I think having xyz constants, which only make sense for 3d, would be odd for a library meant for arbitrary length vectors.
I have not used the vector library however, so forgive me if I am mistaken.
Documentation Features is the wrong category for this Feature Request, but I think you’ll get a faster response if you go through the Luau repository anyway:
Luau only supports either 3 or 4 -component-wide vectors, not an arbitrary amount. You can read the RFC for vector as well as the documentation for it on the official Luau site (although it’s mirrored on the Roblox Creator Hub as well):