# Status effects

**URL:** <https://forums.unrealengine.com/t/status-effects/259620>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [November 7, 2021, 2:52am UTC](https://forums.unrealengine.com/t/status-effects/259620 "2021-11-07T02:52:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smasher6190](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Smasher6190](https://forums.unrealengine.com/u/Smasher6190)\
**Post date:** [November 7, 2021, 2:52am UTC](https://forums.unrealengine.com/t/status-effects/259620/1 "2021-11-07T02:52:26Z")

</div>

What would be a good way to implement a status effect system, things like decrease attack of increase defense any and all help would be much appreciated 🙂

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [November 7, 2021, 8:57am UTC](https://forums.unrealengine.com/t/status-effects/259620/2 "2021-11-07T08:57:15Z")

</div>

You can just do them as floats in the player.

On attack, you decrease the float, and increase it when they get a pickup etc…

---

<div class="post-metadata">

**Author:** ![logic\_looper](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/logic_looper/32/88716_2.png) [@logic\_looper](https://forums.unrealengine.com/u/logic_looper)\
**Post date:** [November 7, 2021, 9:41am UTC](https://forums.unrealengine.com/t/status-effects/259620/3 "2021-11-07T09:41:29Z")

</div>

in the blueprint of the player create boolean like: **isWounded** then use a conditional to check: IF isWounded is TRUE and when it’s true you will run the DecreaseAttack function, else do nothing. You will need to check the state of isWounded continually with a timer. The timer needs to be set to run when the actor spawns into the world. The timer is similar to the tick function found in the C++ code. you can display the status effect on a hud using UMG or just print it as text using blueprints.

---

<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:** [November 7, 2021, 10:11am UTC](https://forums.unrealengine.com/t/status-effects/259620/4 "2021-11-07T10:11:51Z")

</div>

Do not do it with vars if you’re planning on having more than 10 statuses.

Look into how actor components work.

- create a base actor component
- create a bunch of inherited components off that base (fire / poison / HP regen …)
- each component encapsulated status effect logic (fire spreads, poison ticks, health replenishes …)
- when a comp is created, give it to a world entity (player / mob / world prop)
- the comp reaches out to its owner and modifies what’s needed there
- the comps can destroy themselves or something else can remove them

It’s highly scalable and easy to maintain in the long run.

And nothing stops you from having multiple similar effects affecting the target simultaneously - stacking. You absolutely can have 3 different speed reductions active, each with different duration. That’s not something you can do with a bool / float.
