So I’ve followed the tutorial found here. https://docs.unrealengine.com/latest/INT/Engine/UMG/QuickStart/4/index.html and I’ve looked through a lot of the questions about this I’ve change my parent class from pawn to actor however i construct them as Spectator pawns because my game is a matching game. The health bar is greyed out which i assume it means its not filling up. Also the minus health example given in the tutorial I believe is not working. Though this could be because of me trying to do it in the level blueprint rather then the character. However nothing was happening in the characters because they don’t do anything. The P_Health float is set to 1.0 like the tutorial says and its set inside my P1_Spectator blueprint class. I changed it from being parented by a pawn to an actor as I saw someone else fix they’re problem that way however it didn’t fix mine.
Game HUD widget needs a reference to the pawn so we can bind the health variable. In the tutorial I tried to get my pawn by casting it from GetPlayerCharacter how ever it didn’t work for me. So I created a variable in the Game HUD - a reference to my main Pawn - and sat it manually when I created the widget in my main pawn.
What I suggest is setting something instead of getting it by casting if DEPENDENCY isn’t an issue. This makes your HUD dependent to your pawn but in most games each type of pawn has it’s own HUD.
I’ve also noticed that while the HUD gets created by event play pressing these keys does not trigger the event it supposed to any idea why that is? Maybe that’s the source of my problems?