void GetDistanceToNextTarget() { if (Vector3.Distance(ai.controller._goal.transform.position, transform.position) < 2f) { targetTimer = ai.targetResetTime; ai.SetRandomGoal(); } }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { ai = animator.GetComponent <JumpRaptor>(); perception = animator.GetComponent <Perception>(); transform = animator.transform; targetTimer = ai.targetResetTime; ai.SetRandomGoal(); }