how do i make a platform dissapear, as soon as the player touches it?

what i mean is , that you need to be able to stay in the platform , on an undetermined time. and as soon as you leave the platform it gets destroyed ,
i dont want the player just to collide with the platform and destroy it, i want the player , as i said before
beeing able to touch it and then as soon as you leave it , it gets destroyed, peace ,

Make your platfrom a trigger, i suppose the game is 2D so i’m using Trigger2D, and put a .cs with this on it.

void OnTriggerExit2D(Collider2D other)
{
    //If other objects can come in contact with the platfrom
	//you'll have to check if the object thats exiting is the player.
	
	//if it is destroy the platfrom
	
	Destroy(gameObject);
}