Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


magnitude

Returns the length of this vector (Read Only).
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public float magnitude { get; }

Remarks

The length of the vector is square root of
(x*x+y*y+z*z+w*w)
.
If you only need to compare magnitudes of some vectors, you can compare squared magnitudes of them using Vector4.sqrMagnitude (computing squared magnitudes is faster).
Additional Resources: Vector4.sqrMagnitude.