void Update() { if (!EventSystem.current.IsPointerOverGameObject() && Input.GetMouseButtonDown(0)) { var ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray.origin, ray.direction, out m_HitInfo)) { squad.UpdateTarget(m_HitInfo.point); } } }