How do I make a separate state for player's death?

For my project, point of game is to have your character die and then resurrect him.

For example;
Player runs through a puddle of water and gets electrocuted. His body will then enter rag doll, but be “electrified.” If player’s electrified dead body happens to be next to an unpowered switch, switch will gain power from his electrified body.

I want to have various death states, like flattened, on fire, etc, but I have no idea where to even begin. Any tips?

Hey James,

It sounds like you want to unpossess your character when it dies, but leave it’s body in level as a ragdoll, and then spawn a new character. If that’s correct, you can set up a custom function in your Character Blueprint that you can call whenever player interacts with something that kills him. In this custom function, you would set character to simulate physics and become a ragdoll, unpossess it, spawn a new character, and possess new character. Something similar to this:

So, for example, if I want to have a volume that kills character when it is entered, I create a Blueprint with a Box Component that casts to Character Blueprint on Overlap and calls its custom function. character enters, goes floppy, and player possess a newly spawned character.

There are many adjustments that could be made to this. You can give function some inputs that represent different types of death; fire, electricity, etc. Then when mesh becomes a ragdoll, you can give it a different instanced material and spawn some emitters on it that depending on inputs you gave it. You might also choose to possess an observer character for a moment after death, and after a timed delay you would then possess a newly spawned character.

Many, many options. I hope this helps get you started! Let me know if you have any questions.

Thank you for response. This was a great starting point, and seems to work way I want with a few adjustments!

Glad to help! Making this work on my end piqued my interest in your project. It would be cool if you kept community updated on forums when you feel comfortable with presenting some of it. You can do that here, if you’re interested:

https://forums.unrealengine.com/forumdisplay.php?11-Work-in-Progress

Best of luck with project!