Skip to content

Instantly share code, notes, and snippets.

@AmmarTee
Created December 19, 2022 07:39
Show Gist options
  • Save AmmarTee/b9d9e3685a4760ca7bb3175c8942e9e9 to your computer and use it in GitHub Desktop.
Save AmmarTee/b9d9e3685a4760ca7bb3175c8942e9e9 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyAfter : MonoBehaviour
{
// Start is called before the first frame update
public float time;
void Start()
{
Invoke("DestroyMe",time);
}
// Update is called once per frame
void DestroyMe()
{
Destroy(this.gameObject);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment