How to Add max life in Lyra project?

Currently the max health is 100, I want to add an amount of health for each character type.

This is the method I’m using, I don’t know if it’s correct. So far I haven’t had any bugs, and I haven’t tested for multiplayers.

First step is to create an ActorComponet so that you can apply it to a Player Controller or an AI Controller.

Second step I go in B_ShooterGame_Elimination and add it as a component, in this case it’s for the Player Controller.

In B_Hero_Shooter_Mannequin I create a function and execute it after the Character is possessed.


In B_MaxHealt I create a function to apply the effect, it must be executed only once so that the maximum health is not added every time the Character dies.

Finally, I create a Gameplay Abilities Effect and apply it to the variable created in B_MaxHealt.



Result 1000 of Health, I don’t know if this is the correct way that Lyra’s devs created but it works.

4 Likes

Thank you for your tutorial on changing the max health (it was the only one I found for Lyra), but I have a problem with “My Char Ref”. How do I get this and what should I do to get two pin connectors?

You need to create the “Input” which is usually on the left side in the “Details” tab.
In this video I found on youtube the dev creates several Inputs and Outputs.

Thank you, I got it, but it’s still not working. I think it has something to do with the Gameplay Ability Effect, because I get this Error while testing in the Editor “GiveAbilityAndActivateOnce called with an invalid Ability Class”
Maybe I created a wrong Gameplay Ability Blueprint?

Lyra is a complex project that requires intermediate knowledge of how Unreal component logic works. To accomplish this tutorial I created I recommend creating a new blank Lyra project and using UE5.0.3. And test without other elements and modifications.

The correct way to modify Health and add Mana and other elements is using c++ and following the steps in this tutorial. This is the one I’m currently using.

1 Like

This is how you do it!