Getting platform to delay before being destroyed

Hi everyone

I really hope you can help me with this its been annoying me for ages now and I’m sure it should be really straight forward.

Basically I want my character to jump onto the platform but only be allowed to stay there for a certain amount of time before the platform disappears.
This is the code I have.

using UnityEngine;
using System.Collections;

public class PickupScript : MonoBehaviour {

void OnTriggerEnter(Collider other){
	if(other.gameObject.tag == "Island")
		
	{
		
	Destroy(other.gameObject);
		}

}

}

btw I am complete noob at unity and c# coding so any help would be great!
thanks.

Assuming you want the object destroyed even if the player jumps back off, you can change line 6 above to:

Destroy(other.gameObject, 3.5);

This will destroy the game object in 3.5 seconds.

Have you tried putting this in your function

yield WaitForSeconds (5);

and maybe doing it as a function update?

Edit

Also I would personally Put the script on the Platform not on the player?

If collide with player
then wait (5);
destroy