Health bar directly in Player ui?

I was wondering if there was a more direct approach possible for displaying the healt bar of the tank.
First i made a tank variable in the player ui bp

then i tried binding the function to the progress bar.

this doesnt seem to work but i don’t know why?

I managed to get it to work by going into playercontroller.cpp and adding a TankRef to the parameters. No BLUE but definitely GREEN here’s pics:

In Playercontroller.h
Header

In Playercontroller.cpp
Playercontrollercpp

Afterwards go into TankPlayerController_BP and, I changed found aiming component to constructed, and pull another return value from the create widget node and do set tankref, then drag tank ref from FoundAimingComponent. I couldn’t figure out how to get a tank ref without doing that as I am not that super yet :slight_smile:

1 Like

Privacy & Terms