Problem with my fall damage script

Hi there so im working on my fall damage script but im having problems which i cant figure it out im struggling whole day.
Problem is when i get on a ballon which kicks me in the air and when i fell down on floor it works great i die and it waits 2 seconds and im going to respawn, how ever if i fell not from top but walk and then fell under ground it hits the death plane collider it gets bugged out like fps drops to 1 and for 2 seconds it keeps reading dying function the sound the particle and all that and after 2 seconds it goes to respawn and all 3 lifes are gone and end gui shows. I have no idea why its like this, here is my script guys

function Update()
{


    if(last_PositionY > player.transform.position.y)
    {
        fallDistance += last_PositionY - player.transform.position.y;
    }
    last_PositionY = player.transform.position.y;

    if(fallDistance >= 6 && IsGrounded())
    {
        Debug.Log("YouFell");
        BackToNormal();
        BreakDeath();
    }
    if(fallDistance <= 6  && IsGrounded())
    {
        Debug.Log("LowerThan6");
        BackToNormal();
    }
function BreakDeath()
{
    GetComponent.<Rigidbody>().constraints = RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezePositionX;
    GetComponent.<Renderer>().enabled = false;
    yield WaitForSeconds (2);
    player.transform.position.x = xaxis;
    player.transform.position.y = yaxis;
    player.transform.position.z = zaxis;
    player.GetComponent.<Rigidbody>().velocity.y = 0;
    player.GetComponent.<Rigidbody>().velocity.z = 0;
    player.GetComponent.<Rigidbody>().velocity.x = 0;
    GetComponent.<Renderer>().enabled = true;
    GetComponent.<Rigidbody>().constraints = RigidbodyConstraints.None;
    life = life - 1;
    health.currentHealth = health.startingHealth;;
    healthSlider.value = health.startingHealth;
}
function BackToNormal()
{
    fallDistance = 0f;
    last_PositionY = 0f;
}

When i set wait for seconds to 0 or remove this line it works perfect but i want when you die it shows where you died for about 2 seconds and then you go to respawn

Edit1 : Also to detect if im ground im using this

function IsGrounded(): boolean
{
    return Physics.Raycast(transform.position, -Vector3.up, distToGround + 0.1);

}

Any idea guys ?

Thanks for helping

Put a debug.log in breakdeath. Sounds like it is being called multiple times, which would mean you would have to add an extra check to your “if(fallDistance >=6&& IsGrounded())” to ensure every fall only causes 1 breakdeath.

Edit 2: I have tried because the terrain was at 0 , 0 , 0 and i tried to select all and move it at 160 y axis and when i fell at death plane which is at 50y axis it works fine , i tried moving death plane to -10 to see if -10 makes that bug but it didnt all works good now all i did i moved all things at scene upwards at 160y axis but my question is why did it happen, like when i move it back to 0 , 0 , 0 all things in the scene it bugs out when i fell on death plane which is under all things on scene ?

I have put debug log and when i fell from ballon like go on ballon it kicks me in the air and i fell back on plane it reads it once, but when i fell on death plane or any other collider that is beneath main map plane it reads the BreakDeath function multiple times. but it only happens when the main plane is at 0Y axis and fell at anything thats >-6 y axis then it reads it multiple times. But when i move all objects upwards for example at 60y axis and the death plane is under all objects at 30y axis then it works fine. It only reads multiple times when i fell on something thats at -Y axis idk why

I think its something to do with

function IsGrounded(): boolean
{
    return Physics.Raycast(transform.position, -Vector3.up, distToGround + 0.1);
}

or

 if(last_PositionY > player.transform.position.y)
    {
        fallDistance += last_PositionY - player.transform.position.y;
    }
    last_PositionY = player.transform.position.y;

Anyone why it happened ? [ when i drop on object at -y axis it bugs out reads breakdeath function multiple times but when i drop at normal Y axis not -Y then its fine

I want to help you, but I find your posts very difficult to read and understand.
In any case, how do you calculate the distance to the ground?

I calculate my distance to the ground using raycast this function

function IsGrounded(): boolean
{
    return Physics.Raycast(transform.position, -Vector3.up, distToGround + 0.1);
}