UE5 - How to update HEALTH to every class?

Two days ago, I started developing a game in RogueLike style where enemies attack you. I have one main class and four subclasses.

AI_MOTHER [ class ]
AI_Bomber child <300 HP>
AI_Maserisk child <314 HP>
AI_Hunter child <354 HP>
AI_Bomber child <250 HP>
AI_BOSS_Haptec child <750 HP>

I can’t figure out how to update the UI - Rendering bar [Health] for each of them with his HP.

At the moment, as the photo says, I can see the bar only at 300HP. what’s above, the bar stays stable till the Child/class drains at 299HP.

Hey @PsiclonexD! Welcome to the forums!

So you need to make what you have as “300” into a variable!

I suggest “MaxHealth”. Then you do “Health/Maxhealth” to get your %! Because the bar you’re using is 0-1 in decimals, since the health level is over 300, it’s over 1x the max and so it won’t move until dropping below 300 :slight_smile:

1 Like

Yes, i know that. But again, as i said

I have multiple Enemys
With various health

And the barhealth it’s for everyone in the photo. How i can make the bluprint to determine the enemy exact health, for each class?

As above. Add a Max Health var into the base class + functionality that changes it by X. Call in on any child instance and feed it relevant X delta.


I’ll just add that one can see inherited vars on child class by:

image

This one is somewhat elusive.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.