private void ToInvestigate(Vector3 target) { if (cState != State.Investigate) { sight.ResetInvestigation(); preInvestigateTarget = targetLocation; targetLocation = target; prevState = cState; statePreInvestigate = prevState; cState = State.Investigate; movement.InvestigateLocation(targetLocation); count = 0; } else { sight.ResetInvestigation(); targetLocation = target; movement.InvestigateLocation(targetLocation); count = 0; } }