TAKE DAMAGE
- Exposure: public
- UE Version: 5.4
Create an Event AnyDamage event, set it to Do Once. Create the Health Variable, set it to Float. Compile & save, then set the max health value in the Health Variable. Drop that into the graph as "get Health", drag the pin out and type "subtract" and connect the damage pin from "Event Any Damage" to the bottom and the Health pin to the top for the subtract. Drag the right pin from subtract and set it to "Set Health". From there, get a Branch, and have the condition be "Less Equal" 0. For True, you can make it play the death animation, or in my case have a "Dead" Boolean (separate function for death condition) and connect False to Reset on the Do Once. Connect true to your desired outcome and connect that back to Do Once.
ctrl + v