Normalize()
Makes this vector have a Vector2.magnitude of 1.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public void Normalize()
Remarks
When normalized, a vector keeps the same direction but its length is 1.0.
Note that this function will change the current vector. If you want to keep the current vector unchanged, use Vector2.normalized variable.
If this vector is too small to be normalized it will be set to zero.
Additional Resources: Vector2.normalized variable.