How to make an object reappear?

So, I’m trying to make a platform that disappears a couple seconds after the player steps on it, and then reappears after a couple more seconds.

So far, the “disappearing” part works, but I can’t get the platform to reappear. Here’s my script:

public class VanishScript : MonoBehaviour {
    public float Magic = 4;
    public float Seconds = 2;
    

    
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "Player")
        {
            StartCoroutine(Poof());
            StartCoroutine(Wizard());
        }
    }
    IEnumerator Poof()
    {
        yield return new WaitForSeconds(Seconds);
        Destroy(gameObject);
        
    }
    IEnumerator Wizard()
    {
        yield return new WaitForSeconds(Magic);
        gameObject.SetActive(true);
        
    }

The problem is… When you destroy your gameObject, the script can no longer be executed…

Here:

IEnumerator Poof()
     {
         yield return new WaitForSeconds(Seconds);
         Destroy(gameObject);    //THIS LINE!!
     }

There are different ways of doing it… One could be to affect the scale and set it to 0? Or why not disabling the renderer and collider?

I’m gonna put the exemples as comments.

Instead of destroying the platform gameobject in your Poof coroutine, just call SetActive(false).

void OnTriggerEnter(Collider other)
{
if (other.gameObject.name == “Player”)
{
StartCoroutine(Poof());
}
}
IEnumerator Poof()
{
int phase = 0;
while(true)
{
if(phase == 0)
{
phase++;
yield return new WaitForSecondsRealtime(Seconds);
} else
{
if(phase == 1)
{
phase++;
gameObject.SetActive(false); // If script stops when object set inactive you can change the position
//gameObject.transform.position = gameObject.transform.position + Vector3.up * 1000;
yield return new WaitForSecondsRealtime(Seconds);
} else
{
gameObject.SetActive(true);
//gameObject.transform.position = gameObject.transform.position - Vector3.up * 1000;
yield break;
}
}
}

        }