// Update is called once per frame void Update() { if (UnitControl.FindObjectOfType <UnitControl>().unitsSpawned) { spawnAnim.SetBool("spawnNow", false); } }