Hello, I’m using the rather common way to calculate fall damage which is to take your last known velocity and apply damage based on that on landing, but I wanted to get more variation in the fall damage by getting distance fallen and applying damage per 0.2meters for instance. I’m not sure how to track how far I’ve fallen so if someone could point me in the right direction that’d be great.
If you want to keep track of distance fallen, I would store your current z location value in a variable the moment that you are simultaneously moving downward (-z velocity) and not touching the ground (otherwise walking down a slope will count as “falling”). Then later when you hit the ground, get the distance you fell by subtracting your start fall position z and your current z location.
Thanks Graeme_Crackers . I did that and it works, now to just balance out the numbers.
The “Fall Damage” function is just calculating the damage by distance fallen, everything necessary is visible. First branch is connected to event tick, just in case anyone wants to know what I did.
I think that fall distance is a better and a more accurate indicator than velocity as when grabbing some type of objects also hanging into objects the velocity due to impact might give a very high negative reading, thanks and good Job guys.