Health Pickup with Keyboard Input

Hi,

I have started working on a project and have come across an issue when trying to create a health pickup for my character. What I am trying to accomplish is, when my character is within a certain range of my health pickup and is looking at the health pickup, I want to be able to press the E key, and have my players health increased. I currently have the system working so that if the player overlaps with the box collision around my health pickup, it applies the increase in health, and then destroys.

Here is the blueprint that I currently have for my health pickup. What changes should I make in order for this to work as I planned?

Thanks

I mean, for your system, the easiest thing to do is:

HealthBP:

  1. Create a bool “bOverlapped”
  2. Set bool to true on begin overlap after ensuring it’s the character
  3. Set bool to false on end overlap
  4. Create CustomEvent “Use” and add the logic you have already with a branch only allowing true to execute the logic

CharacterBP:

  1. On Pressed E: GetOverlapping Actors
  2. Cast it to that health BP, if valid then use the “Use function”

IMHO: You should learn how to use Blueprint Interfaces aka BPIs.
Zak’s tutorial: Blueprint Communications | Live Training | Unreal Engine - YouTube

Then you can create better agnostic logic.

But this should get you going for now.