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
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
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.
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.
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
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
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.