// Update is called once per frame void Update() { timer -= Time.deltaTime; if (timer <= 0f) { gs.RestartLevel(); Destroy(gameObject); } }