I’ve seen a few other posts about setting up a damage system, but none of them are working for me.
My game is entirely set within the same Persistent Level, so I’m putting a lot of my Blueprint functions in there, including my variables for player health. I have this set fine, and am drawing the value on screen fine.
My problem is when it comes to actually damaging the player. I’ve set up a volume that I’m using an Overlap Event on and then the “Apply Damage” function as pointed out in other threads I’ve seen. This is all fine until it comes to using the event “OnTakeAnyDamage” which will not place into the levels Blueprint unless it is assigned to an Actor within the level, which my Player Character is not. The only way I can get this Event to work correctly is if I place it in the Blueprint for my Character, which then does not work because my Health variable is in my Level Blueprint.
Another method I have had success is with setting up a boolean variable for whether the player is taking damage or not, and setting it to True when entering the volume, and False when exiting. I’ve then used the tick function and a branch to subtract “1” from the Health variable while set to True, however this drains the health at an extremely fast rate, and I do not know how to set it to only do X damage per second.
Is there another way of doing this? Is there some way of telling my Level Blueprint to pass the value of my Health variable on to the Character Blueprint and then return the new value back to the Level Blueprint after damage has been applied?