I am trying to make my character die from fall damage. So I use this code
velocity.y += gravity * delta
fall_strength += 1
But there is one big issue. It is that as long as I am not on the floor, I take damage. I was thinking of storing the y position of the player in a variable after a jump was made and subtracting the y position after the character hits the floor. (the y position will be stored in another variable when the character hits the floor)
Since I just started with Godot, I do not know how to do this.
Also, another concern is with the negative numbers since if my character drops from a negative number, e.g. drop from y = -145 and lands on a negative number when hits the floor, e.g. y = -230, it will give me a positive number. And when my character drops from a positive number, e.g. y = 500, and lands on the ground that is a positive number, e.g. 100, means I cannot put a fixed height limit that my character can fall
How should I tackle this issue?