// Update is called once per frame void Update() { if (cooldown > 0.0f) { cooldown -= Time.deltaTime; } if (cooldown <= 0.0f && PickUp.GetCount() < maxPickUps) { SetCooldown(); //When it's time, set neww cooldown CmdSpawnPickUp(); //Spawn nwe pickup } }