x

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"

Rendering order (HUD)

Hello

i have a simple FPS game and i'm kinda stuck with the HUD.

i have the player controller BP which sets all the different variables (Health, Ammo etc.).

when i launch the game, the HUD won't update until i do something (walk, fire etc.).

i have a function which updates the HUD in the player controller class and i call it whenever i need to update the HUD

i need to somehow call the "UpdateHUD" function before the HUD is being rendered.

thanks

Product Version: UE 4.12
Tags:
more ▼

asked Jul 09 '16 at 09:37 PM in Using UE4

avatar image

addOns
5 3 2 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

All you have to do is call the UpdateHUD function right before you add it to the viewport. You can also spawn the HUD in the controller's Begin Play Event and call the UpdateHUD function right after.

more ▼

answered Jul 09 '16 at 09:59 PM

avatar image

mcpiesburntongues
40 4 4 6

avatar image addOns Jul 09 '16 at 10:18 PM

im sorry, i didn't quite catch that. what do you mean by "call the UpdateHUD function right before you add it to the viewport"? how do i do that? and where does the HUD initially spawns? i don't see anything in the player controller. ( i am currently working on the first person template from UE tutorial projects)

avatar image mcpiesburntongues Jul 10 '16 at 05:14 AM

Oh I see your problem here. You have a default HUD class and I'm assuming its parent class is HUD? You may want to switch to UMG. Anyways, you should be able to call the 'Event Begin Play' for your HUD class and then just call the UpdateHUD function from there. If you need a reference to the player controller to call your function just use Get Player Controller to retrieve it.

(comments are locked)
10|2000 characters needed characters left
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