Having a problem with an enemy health blueprint, I’ve been following a tutorial but making a few changes here and there to suit my own projest but essentially everything is fairly straight forward.
I have a projectile that hits an enemy, checks for a tag (Enemy) and if it finds it, it carries out another function called “Damage Enemy”.
A value of 50 is sent to a “Damage” input on the “Damage Enemy” Function.
Damage enemy is inside a library Blueprint and it carries out another function called “take damage”.
Take damage casts to my enemy character (Called “Grunt”), gets the characters health (Set to 100) and passes both the “health” and “Damage” (from the projectile) Variables to another function called “Take Damage”.
The “Take Damage” function subtracts the damage (50) from the health (100), checks if enemy health is <= Zero (where it destroys the actor) or >0 where it returns the value of “new health” back to the “Damage Enemy” function.
I know everthing is working to this point because if I do a print string from the returned value “New health” it outputs 50 which is correct however…
This information does not seem to update the enemy characters health (So every time I shoot the enemy it returns a new health value of 50).
The target in the take damage node is set to “Target Enemy Health” which is an actor component added to my enemy character blueprint.
I have attached some screenshots below, hopefully somebody will be able to see where I’ve gone wrong.
Finally it might be worth noting that although there is the EnemyHealth component included in the enemy character blue print, it is not actually called in the event graph anywhere.
Thanks in advance for any help you can offer with this! Pulling my hair out at this point!