# How to auto recharge health/shield after delay in lyra?

**URL:** <https://forums.unrealengine.com/t/how-to-auto-recharge-health-shield-after-delay-in-lyra/546606>\
**Category:** Blueprint\
**Tags:** unreal-engine, UE5-0, Blueprint, question\
**Created:** [May 2, 2022, 12:57pm UTC](https://forums.unrealengine.com/t/how-to-auto-recharge-health-shield-after-delay-in-lyra/546606 "2022-05-02T12:57:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![atlasat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@atlasat](https://forums.unrealengine.com/u/atlasat)\
**Post date:** [May 2, 2022, 12:57pm UTC](https://forums.unrealengine.com/t/how-to-auto-recharge-health-shield-after-delay-in-lyra/546606/1 "2022-05-02T12:57:12Z")

</div>

hello i want to automatically regenerate health in the ue5 lyra starter game when a character has not taken damage in a few seconds

i set up this on the Character\_Default and it almost works

 ![lyra_auto_heal_blueprint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/0/b/c0ba0f1bd3ba8e6b1e7b443c3725ed4bf0bf7e59.png)

but i get this error:  
LogAbilitySystem: Error: FGameplayEffectSpec::GetMagnitude called for Data SetByCaller.Heal on Def Default\_\_GE\_Heal\_SetByCaller\_C when magnitude had not yet been set by caller.

i dont know how to set the magnitude. i tried calling a different effect with a static heal amount and it worked, but i want to heal at a constant rate, not based on how fast the tick is

any advice?

edit: i made [a new post about the specific issue with my approach here](https://forums.unrealengine.com/t/how-to-apply-lyra-gameplay-effect-with-magnitude-in-blueprint/546652) but please suggest an alternative approach here that achieves the goal of recharching helath

---

<div class="post-metadata">

**Author:** ![real.dude](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@real.dude](https://forums.unrealengine.com/u/real.dude)\
**Post date:** [May 3, 2022, 3:11pm UTC](https://forums.unrealengine.com/t/how-to-auto-recharge-health-shield-after-delay-in-lyra/546606/3 "2022-05-03T15:11:24Z")

</div>

Hi! I Highly encourage you to read GAS Documentation

> **[GitHub - tranek/GASDocumentation: My understanding of Unreal Engine 4's...](https://github.com/tranek/GASDocumentation)**
>
> My understanding of Unreal Engine 4's GameplayAbilitySystem plugin with a simple multiplayer sample project. - GitHub - tranek/GASDocumentation: My understanding of Unreal Engine 4's Gamepl...

You developed too complex solution and why would you execute it on tick?  
In Lyra you can find an effect that periodically heals character `GE_Heal_Periodic`.  
All you have to do is grant it by default in `AbilitySet_ShooterHero`

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/4/b/e4b6bc29e2f2494f5586994395406b18cf26e0ad.png)

---

<div class="post-metadata">

**Author:** ![Ruyalu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ruyalu](https://forums.unrealengine.com/u/Ruyalu)\
**Post date:** [March 20, 2023, 3:22pm UTC](https://forums.unrealengine.com/t/how-to-auto-recharge-health-shield-after-delay-in-lyra/546606/5 "2023-03-20T15:22:12Z")

</div>

Hi bro,Thanks for your shared.I find a easy way to do this.Hope it can help you.  
1、Create a Gameplayeffect blueprint：GE\_BeenHunt,Set Has Duration time

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/9/fd99a91e8a3c328956c3bf9c33bf0962e14faf29.png)  
2、Set Status.BeenHurt in GrantedTags  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/7/3576ee34f0d40be0b789bb70f5177b2195d30c1a.png)  
3、Create a Gameplayeffect blueprint：GE\_RechargeShield  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/4/304309eae6b7a41e42695f74b8f6f7c0a9a23b40.png)  
4、Set Status.BeenHurt in Ongoing Tag Requirements  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/9/e/89ef27d0ed65e83cdf110c9d7f6f33d42e39c489.png)  
5、Add blueprint at B\_Hero\_ShooterMannequin  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/4/374c2adbd8f8ae34fa6ef6360b9e460f61d55cad.png)  
6、Add Ge\_RechargeShield at AbilitySet\_ShooterHero  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/4/b/44b391e4a2059e0d50a7f3e8b33d60b87b5f14a3.png)

Then run it!
