I’m trying to create a platform that will disappear after a set number of seconds, once the Player steps on it. The code I’ve been using does nothing:
public float Seconds = 2;
void OnTriggerEnter(Collider other)
{
if (other.gameObject.name == "Player")
{
Poof();
}
}
IEnumerator Poof()
{
yield return new WaitForSeconds(Seconds);
gameObject.SetActive(false);
}
I really don’t know what I’m doing wrong. Would somebody kindly help me? Thank you.