// Use this for initialization void Start() { if (beardman == null) { beardman = GameObject.FindGameObjectWithTag("Player").GetComponent<Rigidbody2D>(); } mainCamera = Camera.main; movementController = beardman.GetComponent<MovementController>(); beardAnimator = beardman.GetComponentInChildren<BeardAnimationController>(); playerAnimator = beardman.GetComponentInChildren<Animator>(); }
private void Awake() { beardAnimator = gameObject.GetComponentInChildren <BeardAnimationController>(); }