--!strict
local Part = Instance.new("Part")
Part.Size = vector.create(1, 2, 3)
print("Success!")
Expected behavior:
Given that vector and Vector3 are “synonymous” to the Engine, the typechecker shouldn’t complain that I’m assigning Size to a native vector, there are no errors at runtime.
Actual behavior:
The typechecker incorrectly generates a warning.
Frequency: Always First experienced: 25th February, 2025 (but I would guess that this has existed ever since the vector library was implemented).
I have all Beta Features enabled.
To clarify, I’m specifically referring to assigning properties, not variables, as they do have different API surfaces.
Vector and Vector3 aren’t the same. They don’t even have the same methods so it could result in errors if you tried to use a Vector like a Vector3 and vice versa.
They’d have to make all classes that take a Vector3 a union with vector
My guess is that they’ll deprecate Vector3 and Vector2 to replace it with the new native (to luau itself) vector type. Don’t know if they’ll make Vector3 and Vector2 have an internal type of vector, or completely deprecate them
Vector3 is already a vector beneath the surface, that’s why assigning a vector to a Vector3 property doesn’t throw an error. Also, from what I can tell, there’s less desire to convert Vector2s to also be vectors.
I think things will stay roughly the same as they are now. Vector3 has to remain, because functions have different names and are used differently in the vector library (like, you don’t call :Cross on a vector, you call vector.cross(A, B)).
Just to confirm, Vector3 in Roblox is backed by the native vector primitive in Luau, and has been for a while before we launched the vector library to make using the primitive possible in standalone Luau. There’s no plans to deprecate any existing Roblox APIs, and the VM is set up to allow any embedder of Luau to provide extended library functionality for vector just like Roblox does. There’s work that needs to be done here on the type system side to better support vector, but this bug report is legitimate, and we will continue to work on this so that we can make the Roblox-builtin Vector3 definition as simple as a direct type alias like type Vector3 = vector.