Legacy Documentation: Version 2017.2 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Vector4.magnitude

public float magnitude;

Description

Returns the length of this vector (Read Only).

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 sqrMagnitude (computing squared magnitudes is faster).

See Also: sqrMagnitude.

Did you find this page useful? Please give it a rating: