So when an AI gets to my target location, it calls a function that is on my HUD, I also tried using a custom event - the event and function both says to take 1 life off in my HUD.
where is your Lives var stored? If this is per player variable, then i recommend store it in player controller bluprint, since there should be only 1 player controller per player. Then in your HUD function “Remove a Life” you can do this:
Get Player Controller (at needed index, 0 will be current player even for multiplayer games)
cast it to you custom player controller (if you have it)
get access to Lives Var of that controller, just draw out cord from player controller reference, disable context sensetivity and write “Get Lives Var”.
seems this is the problem, because every user in multiplayer will have his own HUD widget and his own variable, so try move it to gamestate because seems only one exist per type and game
GameMode class, for example when you open Third Person Template there’s standart blueprint ThirdPersonGameMode and this is exist only as 1 instance per level i think, better place you lives counter here because you can simply get access to current game mode
you told your counter in HUD blueprint, but every player have his own HUD and probably you can’t get reference to client’s hud also every player will have his own counter in this way
The idea i trying give you is just a code design following next rules:
***** if you need store anything related to whole game and not to every playr, better place would the class that exist only as single instance and accessible simply from everywhere, example values
total player lives (your variable), game pause state wave number and so on
better store all these in GameMode blueprint or level blueprint, here is screenshot of third person template and it’s default GameMode blueprint, note that you can create your own blueprint based on GameMode class and assign it as default in project settings
***** if you need to store something related to player better place would the class that is player related, it’s PlayerController, example values
player’s lives (not unit’s, but whole lives for player like in TD games), player’s inventory size (for RPG style games), player’s level (for RPG and MMO style games)