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

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

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 but please suggest an alternative approach here that achieves the goal of recharching helath

2 Likes

Hi! I Highly encourage you to read GAS Documentation

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

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


2、Set Status.BeenHurt in GrantedTags

3、Create a Gameplayeffect blueprint:GE_RechargeShield

4、Set Status.BeenHurt in Ongoing Tag Requirements

5、Add blueprint at B_Hero_ShooterMannequin

6、Add Ge_RechargeShield at AbilitySet_ShooterHero

Then run it!

1 Like