How do I get a player to take fall damage/die from a fall?

how do you make player die from a fall. it seems by default player can fall from any height and live.
I posted this question before but after realized it got posted in wrong section thus am reposting it here. thanks for reading I hope I not only one wondering this.

Hey ,

Depending on your world settings, it may seem like character will fall forever. There is a Kill Z setting in World Settings that reflects maximum size of your world (which I believe depends on hardware, though I am not certain), and your character will need to fall past that for it to take effect.

What you probably want to do is set a volume which will kill character when it passes into it. simplest way to set this up is with a KillZ volume. Make it large enough to encompass area your character can conceivably fall (or use multiples, depending on your map) and make sure it is tall enough to detect character if it is falling quickly.

Judging from your other question ( How do I get a player to take fall damage/die from a fall? - Programming & Scripting - Epic Developer Community Forums ), you want something a little more complex than that, that takes your character’s velocity into account. You can do this with a standard trigger volume. In Blueprints, you can either do damage to player or destroy Actor, depending on effect you’re looking for, when character is in volume and its velocity is appropriate number.

If you’re looking to have this happen upon impact with a floor, you can use a On Hit or On Overlap event and check your condition then.

Hope that helps!

1 Like

Hi
thanks for posting . However trigger volumes are obvious anwser but not really an option for my project, otherwise I wouldn’t have had to post here. game I working on has a lot of verticality and it would just be an obserd amount of trigger placing and level streaming to get them out of way and loaded back up ect. ect.

My thoughts are like this you see I know UDK well, and with udk I had a simple unrealscript function in my pawn class, that function worked something like this.
if player is falling it gets players Z velocity if velocity exceeds a set value when player hits floor or ground, it applies damage. I am hopeing to rebuild that function with blueprint or C++ code.

As I never got into kismet much I having trouble wrapping my head around blueprint. I posted here as I still can’t believe I only one who wants this. I still working on it when I find proper answer I will post it up here for inevitable next person. I’ll check again for an On Hit
thanks again

What i have done is when in falling state i track Z velocity which should be negitive when falling. Once falling z velocity is past my falling threshold i set a take falling damage variable. When landing I apply damage only when this switch is true.

Also I weigh velocity between 2 falling threshold to apply a variant damage on land depending on how long player fell.

If you need a visual i can post something when i get home.

A visual may help greatly. but just knowing someone else got it gives me a smile.
Thank you.

Ah, okay. You can definitely do this with Blueprints! Hopefully you’ll get some attention in your C++ question as well, so we’ll leave that one up there.

With Blueprints, you probably want to attack this by assigning each platform mesh (anything a player could fall and die on) to a custom Object Channel. You can create an Object Channel in Edit > Project Settings >Collision. Create a New Object Channel, name it Floor or something distinct, and set it to Block All by default. Then in your Static Mesh or Actor Blueprint for your platforms, make sure Collision Preset is set to Custom with that Object Type (or you can create your own Collision Preset with that Object Type as it’s default… so many options!).

Then, you can set up something like this in your pawn’s Blueprint:

All this does is checks if pawn’s velocity is below a certain value, then casts to Actor it hit to see if its Collision name is Floor, and destroys pawn if all that is true. You can certainly customize this to detect different velocity and to deal damage to pawn instead of outright destroying it, but this example hopefully gives you idea of how it should work.

Hope that helps!

Here you go.

Thank you, these are good points in right directions.