Check out example codes for "unity fall damage c#". It will help you in understanding the concepts better.

Code Example 1

using UnityEngine;

public class Collisions : MonoBehaviour
{
    [Tooltip("In Meters")]public float distanceAllowedToFall;

    float jumpHeight;
    float landingHeight;
    float fallDistance;

    private void OnCollisionExit(Collision collision)
    {
        jumpHeight = transform.position.y;
    }

    private void OnCollisionEnter(Collision collision)
    {
        landingHeight = transform.position.y;
        HealthDrain();
    }

    void HealthDrain()
    {
        fallDistance = jumpHeight - landingHeight;

        if (fallDistance > distanceAllowedToFall)
        {
            // Damage Player
        }
    }
}

Learn ReactJs, React Native from akashmittal.com