The title is kind of self-explanatory.
I have a message that pops up when a user clicks a specific object, and I’d like it to disappear after a few seconds. How might I achieve that?
Thank you so much.
The title is kind of self-explanatory.
I have a message that pops up when a user clicks a specific object, and I’d like it to disappear after a few seconds. How might I achieve that?
Thank you so much.
Destroy has an overload that takes a delay time. Unity - Scripting API: Object.Destroy
I’m really new to Unity, and scripting, would you mind posting an example? This page doesn’t give one. ![]()
EDIT:
Nevermind, I was able to get it working! Thank you for your help!
using UnityEngine;
using System.Collections;
public class DestroyObj : MonoBehaviour
{
void Update ()
{
Destroy (gameObject, 2);
}
}