// Use this for initialization void Start() { if (!_target) { GameObject.Find("Player"); } // Initialize each State _patrolState.Init(_patrolingPoints, _detectingRange); _chaseState.Init(_target, _detectingRange); ChangeState(_patrolState); // agent won't be stop _agent.autoBraking = false; StartCoroutine("LostPlayer"); }