using UnityEngine; public class RemoveAfterSeconds : MonoBehaviour { public float seconds = 2f; private void Start() { } private void Update() { seconds -= Time.deltaTime; if (seconds < 0f) { Object.Destroy(base.gameObject); } } }