Get variable from EVENT HIT, another class

Hey! I have a question

In my Bullet_01Basic I do have the event HIT
i made the Print debug to see if it’s recognize only the enemy [the bullet]

I have 5 ChildBlueprints from AI_ENEMY. wich spawns random
The question is: How do i get ENEMY_HEALTH from every child, [they have different HP] And apply damage to it. Also, how Apply point damage works? the base Damage?

I wanna create a Top down Shooter btw. Ty!

Long short exp:

Event hit > Cast to AI_ENEMY > AS AI_ENEMY > GET MAX_HP .
Event hit > Cast to AI_HUNTER > AS AI_HUNTER > GET MAX_HP .

How do i cast to every AI child [ ENEMY IS THE ,MOTHER"] To get the MAX_HP, so i can substract the damage my player have SMTH like

Event hit > CAST TO ALL ACTOR OF CLASS > GET MAX_HP > SUBSTRACT DMG_PLAYER - MAX_HP .

can’t get it to work, any ideeas?

Hi, generally if Max_Health variable is in master class (AI_Enemy) then you don’t need to cast to child classes. You can cast to parent class and get this variable.

PointDamange is built in Unreal interface and this is much better approach than casting. So you can use apply point or radial damage in your bullet. And in your enemy class use event AnyDamage (or PointDamage).
Apply damage is a message and any damaged actor will receive it and will trigger it’s damage event.

1 Like

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