void Start() { GameObject timerObject = GameObject.FindGameObjectWithTag("Timer"); if (timerObject != null) { timer = timerObject.GetComponent <TimerTillFree>(); } else { Debug.Log("FoodForBob Can't find TimerObject"); } }
void Awake() { player = GameObject.FindGameObjectWithTag("Player").transform; Bob = GameObject.FindGameObjectWithTag("Bob").transform; nav = GetComponent <UnityEngine.AI.NavMeshAgent>(); GameObject timerObject = GameObject.FindGameObjectWithTag("Timer"); if (timerObject != null) { timer = timerObject.GetComponent <TimerTillFree>(); } else { Debug.Log("ChickenMovement Can't find TimerObject"); } inBobRadius = false; anim = transform.GetComponentInChildren <Animator>(); }