private void Start() { anim = GetComponent<Animator>(); player = Object.FindFirstObjectByType<Player>(); }
код:
с 'player' тоже самое