Length (or magnitude) of the vector (Distance from 0,0,0).
Length (or magnitude) of the vector (Distance from 0,0,0).
To access the length of a vector, simply use the Length
property on a Vector3
instance. This property returns a float
representing the distance from the origin (0,0,0) to the point represented by the vector.
Vector3 myVector = new Vector3(3, 4, 0); float length = myVector.Length; // length will be 5