Disappearing Platform when jumping on top.

Building a simple platformer, is there way for unity to detect where on the platform the player collides- so the platform destroys itself? I want the platform only destroyed if the player lands on top of the platform. If the player collides on the side, or bottom, i don’t want the object (platform) destroyed.

using System.Security.Cryptography.X509Certificates;
using UnityEngine;
using System.Collections;

public class DisappearingPlatform : MonoBehaviour
{

    public GameObject playerLocater;
   

	// Use this for initialization
	void Start ()

	{

	    playerLocater = GameObject.Find("test");
	   

	}


    void OnCollisionEnter(Collision disappearingPlatform)

    {
        if (disappearingPlatform.gameObject == playerLocater)
        
        {
            Destroy(gameObject);

        }

    }


}

Cast a ray from the player’s origin downside, if it hits something see if it is a platform, if so, destroy it. Example

Instead of using a collider that has the same shape and size of the platform, you can edit it so that the player can only collide with it if he is in contact with the top of the platform. Something like this:
[20611-collider+example.png|20611]