Use Vec2.magnitude() instead
vector.magnitude()
Returns the magnitude of the given vector.
Use Vec3.magnitude() instead