using System.Collections; using System.Collections.Generic; using Mirror; using UnityEngine; public class DestroyAfterTime : MonoBehaviour { public float timer = 2f; void Start() { } void Update() { if(timer > 0){ timer-=Time.deltaTime; return; }else{ NetworkServer.Destroy(gameObject); } } }