I'm trying to figure out how to do Area of Effect damage with blueprints. I want to make it so say, if a character is standing on a type of floor or is inside a certain collision sphere their health will gradually go down. I've tried to have a while loop but the health just depletes in an instant, and putting a delay inside a while look just causes an infinite loop for some reason. I just want it to take a bit of health away gradually for as long as the player is in the AoE
asked Jun 21 '16 at 04:04 PM in Blueprint Scripting
When the actor steps on the tile, or enters the sphere, you could create a looped timer using Set Timer by Function Name. So, for example, every 5 seconds you could apply damage.
Keep a reference to the timer handler (return value from the node). You'll want to cancel it the moment they leave the hazard.
Example of handling this via a timer. This has a bug (you'd want to call EndAOE on player death)
Follow this question
Once you sign in you will be able to subscribe for any updates here