Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Find actors in map and display their variables on HUD

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.

I'm thankful for any help you can provide.

Product Version: UE 4.10
more ▼

asked Apr 16 '16 at 02:02 AM in Blueprint Scripting

avatar image

23 1 3 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Create HUD Blueprint and setup a Custom Event to "Update HUD". Something like this: alt text

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.

[2]: /storage/temp/87087-actors+and+hud.zip

1.png (184.8 kB)
actors and hud.zip (455.7 kB)
more ▼

answered Apr 16 '16 at 02:23 AM

avatar image

Nick Jackson
492 17 14 107

avatar image gooberCP Apr 16 '16 at 03:02 PM

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)

avatar image Nick Jackson Apr 17 '16 at 02:12 AM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question