Looking for fall damage tutorial

I looking for a good and short fall damage tutorial
I saw some on youtube, but most were like the bps already done and very long
The only one I saw that was small and did from the beginning
Did not work for me

So if anyone knows of a tutorial in video or images, I would be very grateful

Take a look at this thread discussing fall damage.

Hope it helps.

That’s time based which is offer is fine for single jump etc but what if we’re talking multi jump. Guess it’d hafta be reset each jump but could reset the time each jump.

What about on jump you set current actor location vector and on land compair the distance on Z axis. Then based on a distance you want damage to apply do so

Actually the location would need to be determined when player starts moving down.

Just a thought, start a timer that begins when the player character reaches a certain negative Y velocity.

@GuilhermeAU

Made a little video for you. There are many different implementations you can use, so you don’t need to use my particular method, but it might give you an idea, how to handle this stuff :).
NOTE: The text, which is printed last is a negative value. That is, because my health value wasn’t big enough to sustain the amount of damage caused by the fall. What you do with the math is up to yourself. You can cap the “Z-value” with a “clamp (float)” value, if you want to have a limit, how much damage can be applied maximally.

https://vid.me/jxbT

Hope I could be of help.

If you want to be realistic, Damage should be determined by the Velocity, not the Distance or Time you traveled in air.

Heres what i did tooling around before leaving work,

enjoy

So I tried both methods thanks who helped me
But there is a problem
I want fall damage that takes into account my life.
Because when I go to test it’s hit kill, I lose my whole life at any altitude
If I jump I lose my whole life

This was the tutorial I used before to do before

If I do not understand wrong, I think it’s very likely that I’ve got it wrong.
But from what I’ve seen it picks up from the time you start to fall and you take damage when you land on the ground or transform the height you dropped and turn it into damage and then divided the value if the value is greater than your life you Die, if it is smaller than your life subtracts from it

I tried to mix to see if it works, but it did not work ‘-’

Currently moving no pc to look at this closer but what is your health float at for max health?

usually widgets display 0-1 for a progress bar. But if your damage isn’t scaled to your health right or umg not showing health right could be a problem.

For instance if you use a float for health of zero to one you’d likely want to make sure your damage is applied in that range or you use 100 health for example and divide it by 100 in umg to get the 0-1

To expand on this for damage depending on range decide max distance for death and minimum damage for say low damage and bra he it first for => death distance and if false you scale it so say 5000 units is hurt and 20000 is death use a scaler to make that between .01-.99 and multiple your Max allowed health to get the scaled damage float.

Actually I’d do this sorry for rambling


Branch on impact for should cause damage, take distance of that drop and go into the float map from that value to max distance of whatever you think is a lethal distance. On other end of the map input lowest damage and lethal damage. Then that return to how much damage is applied.

I was able to correct this problem
I moved some sticks here and others
It’s working now, not the way I wanted it to, but it’s
But now I have another problem :v
Video of the problem I’m having right now
The beginning of the video was just to test if it was working

[video]- YouTube

Are you still changing health on both true and false?

when we measure the vector difference we are looking at a negative distance so we are looking for is my distance < distance like normal height is -400 difference and higher is technically less then that so -2000 < -400.

On land is distance < -800 true ok cause pain
 Pain is distance -800 to -1500 mapping that alpha float .01 - 1
 Damage = MaxDamage*alpha

Yes, true is that in case the damage is greater than my life I die
And false is only to subtract the damage

There are multiple ways to achieve fall damage. Personally I use the player movement’s “IsFalling” value. As soon as it start I check the player’s height. Then when it ends (when the player lands) i check the player height again and then compare it to the height at the begiining of the jump. If this value is bigger than say 5 meters, the player get’s fall damge. The higher the fall height the bigger the damage. Very easy to implement really. If I have time I’ll share the blueprint code.

175facf8fc332b24e8b90944b2822f12b2dd4dd5.jpeg

Current State of BP

I managed to fix it because I was using negative numbers
Thank you all for helping me