public static float GetPitch(this Vector3 v) { float len = Mathf.Sqrt((v.x * v.x) + (v.z * v.z)); // Length on xz plane. return (- Mathf.Atan2(v.y, len)); }