You can extract any number of variables you want from wherever they are stored.
Example project attached. In this project I have several actors with different call-signs. These call-signs are displayed in the HUD. Yell out if you get stuck.
Hey guys, looking for a little guidance on a HUD feature I’m working on. I need to have a HUD display of various variables from actors in the map.
Let’s get some stuff out of the way:
-I have an actor class (capturezone01) which gets dropped into a map (as many of them as the mapper decides can be in a single map - normally 3-7).
-My gametype is already set up, it finds all the actors of type “capturezone01”, adds them to an array of actors, and keeps track of points each team has.
-The gamemode blueprint already stores an array of actors containing each “capturezone01” actor, so I think I can just use that to determine which actors to draw values from.
The HUD widget needs to be able to (on map load) determine how many “capturezone01” actors are in a map, and for each one, display the following variables on the player’s HUD: ShortName, CaptureStatus, Team1Percent, Team2Percent. These variables are all stored in the actor’s blueprint, and are all replicated to all clients.
Is anyone able to give me some direction on this? I’ve been experimenting with various methods for the past few hours. I’ve tried every way I can think of to get it to work, but still nothing.
Thanks man! Based on what you provided, I was able to get static values (such as the ShotName of each capture zone) displayed on the HUD.
Having some difficulty with dynamic values through (like RedPercent/BluePercent/CaptureStatus). Seems to be no problem to get the values when the map loads, but the values aren’t updating on the HUD as they change (like Health and Armor are)
It depends on how you’ve setup your updates. If you followed the pattern above, just call Update HUD event every time you update your other variables (like Capture Status for example). So where you Call Update Capture Status, also put in Update HUD node.
If that sounds like too much work, you can setup a variable in the HUD and a direct bind. This works fine for most situations and will take care of HUD updates automatically. The only drawback of doing it this way is that it executes on every frame update, thereby potentially increasing your cost. It will work for your prototype but you’ll probably want to avoid that in the final product, hence I didn’t recommend that to begin with.