void FixedUpdate() { brightness -= Time.fixedDeltaTime * 0.5f; if (brightness <= 0) Destroy(this); mat.SetFloat(ID, brightness); }