I’m completely new to UE5 blueprinting, and was wondering how I can make a damage over time function that only happens when inside a certain area? For reference, I want to make a toxic cloud area that makes the player lose 5 oxygen points every second they spend inside the cloud. I thought using the default damage nodes (where damage = loss of oxygen) was the best option, but I have no idea.
This is my simple damage setup, but it will obviously not loop/apply damage every x seconds. How do I make it repeat at a constant pace when player is inside the BP area (which is a box collission)?
One can right click any pin in the engine and promote it in order to automate and speed up the variable creation process; and you will end up with the correct type. And it’s connected. The fewer clicks, the better.
Here, it’s useful to have it so you can manipulate the timer:
Thank you so much, however, I set up a new blueprint as the one you’ve shown me, and although it works, I can’t control how much damage/oxygen loss is applied every x seconds in the “Apply Damage” node.
In Apply Damage I have set Damage=5, but this BP doesnt communicate with my setup in BP_FirstPersonCharacter, and the amount of damage isn’t affected by what I put into this node.
This is in BP_FirstPersonChar. Just a print string setup. What do I connect to the Subtract node to have it reference the damage set in the Apply Damage node in the other BP? How do i connect these to blueprints? Should I move these nodes to the other BP?
recalling it while active, won’t add it to a queue but will reset the timer.
But if you have a variable float connected to the pin Time and this value has changed, then yes, it will be reset.
Note: not all latent node has that behaviour, Load Async asset for example, recalling it will make it in some kind of queue.
This way you can make obstacles that will shield an entity from damage, so the pesky exploding barrel won’t hit us through a wall. Note that no iteration is required here, we hit all actors but the damage can be ignored on the receiving end, or simply remain unimplemented.
@ingridbie - you may also want to eventually look into the Damage Type Class - once you wrap your mind around the concept, it will trivialise handling stuff like elemental damage, bludgeoning damage, resistances, mitigation and so on. Think of it as of a damage processor.