Vector* non number args don't throw error, treated as 0

If you pass a non number to a Vector3 or Vector2, it’s treated as 0 eg Vector2.new(1,true)==Vector2.new(1,0) or Vector3.new(Vector3.new())==Vector3.new().

2 Likes

Is this necessarily a bad thing?

2 Likes

The ship has probably sailed on the refactor of this one. Making it throw could break existing games.

3 Likes

Hello, thanks for the report. Unfortunately, fixing this isn’t currently on the roadmap. As has been said above, such a change can have disruptive effects.

2 Likes

Some more detail on this issue: I tried really hard to fix this, going so far as gathering analytics on exactly how much people are relying on this in live games.

The answer is unfortunately: A lot. So yes, the ship has sailed on fixing this.

Fortunately Luau will significantly lessen the chance of running into bugs caused by this in the future.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.