Created
December 19, 2022 07:39
-
-
Save AmmarTee/b9d9e3685a4760ca7bb3175c8942e9e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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