private void UpdateLeadingFoot() { float leftDistance = Vector3.Distance(LeftFootReference.transform.position, ForceController.Instance.GetDirectionPoint()); float rightDistance = Vector3.Distance(RightFootReference.transform.position, ForceController.Instance.GetDirectionPoint()); if (LeftFootReference != null && RightFootReference != null) { if (Mathf.Abs(rightDistance - leftDistance) < NeutralSweetSpot) { LeadingFoot = LeadingFootEnum.Neutral; } else if (rightDistance > leftDistance) { LeadingFoot = LeadingFootEnum.Left; } else if (leftDistance > rightDistance) { LeadingFoot = LeadingFootEnum.Right; } } //Debug.Log(LeadingFoot); }
private void UpdateLeadingFoot() { float leftDistance = Vector3.Distance(LeftFootReference.transform.position, ForceController.Instance.GetDirectionPoint()); float rightDistance = Vector3.Distance(RightFootReference.transform.position, ForceController.Instance.GetDirectionPoint()); if (LeftFootReference != null && RightFootReference != null) { if (Mathf.Abs(rightDistance - leftDistance) < NeutralSweetSpot) LeadingFoot = LeadingFootEnum.Neutral; else if (rightDistance > leftDistance) LeadingFoot = LeadingFootEnum.Left; else if (leftDistance > rightDistance) LeadingFoot = LeadingFootEnum.Right; } //Debug.Log(LeadingFoot); }