polarjp.blogg.se

Falling dmg
Falling dmg









falling dmg

even though they land softly on the platform because its at the peak of their jump, they might die from being in the air for too long, which would look weird. your system would not work so well if a player was launched up to a high platform. That is it! Very simple set up that you can then plug into your HUD or whatever.įalling damage in real life is caused by a sudden change in velocity, not prolonged exposure to air time. We then print out our current Health value to the screen. If true we subtract FallDamage from Health and then set Health as the result. In addition, if you fall into water, snow, or another relatively soft substance, you can treat the fall as though it were 20 feet shorter, or 30 feet shorter if you intentionally dove in. You can Grab an Edge as a reaction to reduce the damage from some falls.

falling dmg

We then check if IsFallDamage? is true or not, printing out NoFallDamage if false and dealing damage to our character if true. You fall about 500 feet in the first round of falling and about 1,500 feet each round thereafter. We then set both StartAirTime and EndAirTime to ZeroOut to prepare for the next time we run this sequence. So we set FallDamage to the result we got from subtracting StartAirTime from EndAirTime. We want to damage our character on a sliding scale so that the longer our character is falling the more damage our character will incur when it lands. If the result is greater than 1.5 we set IsFallDamage to true. I want to incur damange when my character has been in the air for over 1.5 seconds, so we subtract StartAirTime from EndAirtime and see if the result is greater than 1.5. We then need to find out if the time our character has been in the air is long enough to incur damage. When your character lands we set EndAirTime to the elapsed game time. Here you are setting StartAirTime to the elapsed game time when your character jumps. I’m sure there are alternatives to create fall damage but here is how I did it.











Falling dmg