More and more often I see developers and other people using Vector3.Magnitude to represent a Vector3 as a single number instead of using it to get the distance.
e.g.
Vectors contain two components, direction (.Unit) and magnitude (.Magnitude).
Magnitude isn’t strictly for measuring distance, it’s to measure size. Distance is a “size” between two points.
Speed is a “size” of a velocity.
Let’s say we have a car moving at a velocity of (20, 0, 0).
The magnitude, or “size” of this vector would be 20. This is a scalar value, meaning without direction.
The unit or direction of it would be (1, 0, 0). This is a value without scale.
Another way to look at it would be something like 5 miles north.
5 miles is the distance or magnitude, north is the direction.
A vector’s magnitude is the square root of the sum of all of it’s components squared. magnitude = sqrt(vector.X^2 + vector.Y^2 + vector.Z^2)
I’m not saying you can’t use math.abs(someVector3.X) if you only wish to utilize that single axis, but there’s a substantial difference if you want the scale of the entire vector.