using System.Collections; using System.Collections.Generic; using UnityEngine; public class AutoDisable : MonoBehaviour { int t; private void Update() { t++; if (t > 5) { t = 0; gameObject.SetActive(false); } } }