void Start() { top = cage.GetTop(); bottom = cage.GetBottom(); left = cage.GetLeft(); right = cage.GetRight(); GetNewTarget(); }
private void Start() { top = cage.GetTop(); bottom = cage.GetBottom(); left = cage.GetLeft(); right = cage.GetRight(); anim = GetComponent <Animator>(); if (anim == null) { Debug.LogError("No Animator on Animal"); } lastIdlePos = transform.position; GetNewTarget(); isMoving = true; }