# Problems with damage and status effect

**URL:** <https://forums.unrealengine.com/t/problems-with-damage-and-status-effect/648451>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint\
**Created:** [September 14, 2022, 9:37am UTC](https://forums.unrealengine.com/t/problems-with-damage-and-status-effect/648451 "2022-09-14T09:37:17Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [September 26, 2022, 11:26am UTC](https://forums.unrealengine.com/t/problems-with-damage-and-status-effect/648451/8 "2022-09-26T11:26:14Z")

</div>

> [@LoadingUserName](#):
>
> Two problems I have now is I can’t get my burning DoT to stop after 10 seconds

A really versatile method I can’t recommend _enough_ is through actor components.

When event happens, we dynamically create and attach an actor component to target actor. This components can deal damage, heal, shows particles, count time and handle anything related to this effect. When the timer expires, the component destroys itself.

Some examples:

> [@Healing of damage over time](https://forums.unrealengine.com/t/healing-of-damage-over-time/152498/4):
>
> The component has 1 function (top) and 1 custom event (bottom): Variables: Injury Type is an enumerator (Mild | Moderate | Severe) Health Modifier - how the component affects Player Health Recovery Time - how long it persists in seconds When added to the player’s blueprint, we run the \*Set Recovery and Health \*function (as seen below). The component is then configured according to the Injury Type; here, we set Recovery Time and the \*Health Modifier. \*We also Set Timer By E…

> [@How to start making an Oblivian style Spell creation system](https://forums.unrealengine.com/t/how-to-start-making-an-oblivian-style-spell-creation-system/619474/5):
>
> This. @AndracoDragons look into actor components. Each component can host variables and define behaviours. A spell actor can have any number of those components present. These can be added and removed dynamically, too. Here’s a crude & overly simplified example: a spell actor some of components defining the behaviour / effects of the spell: the component hurts pawns with fire damage every .25s for as long (up to 4s) as they stay within the spell’s Area Of Influence defined by th…

> [@How to make potion that heals over time?](https://forums.unrealengine.com/t/how-to-make-potion-that-heals-over-time/118293/4):
>
> You could make a simple event that regenerates player’s health using a timer. For something very simple it might just be enough. But there is a better, more modular method that does not limit you to having a single effect affecting the player (or any other entity for that matter). Think of it as of a temporary effect (or an ability) that the player gains for X amount of time and once the time is up, the effect expires. And more of those can be active at the same time, too. So imbibing a couple …

> [@Is there a better way to handle this](https://forums.unrealengine.com/t/is-there-a-better-way-to-handle-this/449749/4):
>
> Well im planning on adding more Debuffs and wanted to know if there is a easier/more efficient way of doing this. There is. Consider the following and see if it’s applicable to how you need your systems to work. Actor Component - can be created in the Content Browser, it’s a piece of reusable functionality that can be added / removed from actors, during run-time too - that’s what we’re doing here. The general idea is: design an actor component that acts as a buff / debuff for each effe…

* * *

The official vid I learnt it from:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/c/bcc3d0df50158c1955c450c29b3b9bbd255898a3.jpeg "Using BP Components for Game Behaviour | Live Training | Unreal Engine") ](https://www.youtube.com/watch?v=qr4ZjieAQKY)

This approach allows you build modular, easily scalable systems where the functionality is encapsulated within the component - so you do not need to burden the Player, NPC, Enemies or world entities with all possible combinations of what could happen to them.

You instead spawn a desired effect on them and it goes away on its own.

---

_[View the full topic](https://forums.unrealengine.com/t/problems-with-damage-and-status-effect/648451)._
