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"

Basic UI not showing up?

Hi,

I've setup the most basic UI ever and its not showing up. I've created an ability bar (hotbar) to show up at the bottom of my screen in a widget blueprint, and that's it. alt text

Then ive created a HUD blueprint, this basic.

alt text

/ And it doesn't work. What am I doing wrong? Any help greatly appreciated, thanks.

Product Version: UE 4.20
Tags:
screenshot-3.png (345.8 kB)
screenshot-4.png (399.4 kB)
more ▼

asked Sep 18 '18 at 07:55 PM in Blueprint Scripting

avatar image

Danial.28
1 1 2 2

avatar image Everynone Sep 18 '18 at 09:14 PM

Is the HUD class part of the Game Mode you're using?

avatar image Danial.28 Sep 19 '18 at 02:36 PM

I think so yeah.

avatar image Danial.28 Sep 19 '18 at 02:36 PM

Ah ok thank you.

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

1 answer: sort voted first

You shouldn't be creating the widget and adding it to the viewport in your HUD blueprint, instead do this somewhere else like in the player blueprint or the level blueprint. Once you call Add to Viewport your widget becomes a child component of your HUD, you can almost forget about HUD blueprints and just add the widget to viewport in what you consider the most sensible place.

more ▼

answered Sep 19 '18 at 12:01 AM

avatar image

bool'
1 2 4 8

avatar image Everynone Sep 19 '18 at 08:01 AM

I will completely and utterly disagree with this. HUD is a great place to keep the widgets in, one centralised hub accessible from anywhere in the game - it's a framework class with additional unique functionality (Event Draw to name one).

Level Blueprint is by far the worst possible choice here as you cannot access anything that's referenced there...

avatar image bool' Sep 19 '18 at 09:22 AM

I would agree that usually level blueprint is an awful place to do this, depending on whether or not you will be referencing it, the player blueprint normally works perfectly well because you can easily make a variable when you first create the widget for referencing in other blueprints and it is fare easier (imo) to add and remove widgets in the blueprint of the character / actor that uses the widget for sake of what makes sense for when you reference it later if you do. If you are just trying to get your widget to show when the level starts and you won't be altering it or referencing it the level blueprint will suffice to actually allow you to see it on the screen if you want to test it

avatar image Everynone Sep 19 '18 at 09:45 AM

Epic once had plans on beefing up the hud class and make it a dedicated host for widgets, actually. Wonder what happened to that idea.

It's still super useful when you want to draw a bunch of lines to connect widgets or lines that connect widgets with world objects. Or when your project is UI heavy and you need stuff organised and communicate efficiently with next to no casting. Also dispatcher automation, since you have all references in one place - bind events and forget about null references.

avatar image bool' Sep 19 '18 at 09:52 AM

Ah yeah, I wasnt aware of that, good to know cheers.

avatar image Danial.28 Sep 19 '18 at 02:37 PM

I managed to get it working by doing everything in my character blueprint instead, thanks guys.

avatar image Everynone Sep 19 '18 at 03:28 PM

I managed to get it working by doing everything in my character blueprint instead, thanks guys.

So you tried to use the HUD without ever assigning it to the GameMode?

avatar image Danial.28 Sep 19 '18 at 06:23 PM

No I told you I did assign it to the HUD class, what do you mean?

avatar image Everynone Sep 19 '18 at 07:41 PM

When you extend a custom HUD, you need to tell your custom game to use it, note the HUD:

alt text

The same goes for other framework classes.


But no worries, you got it working and that's what matters, keeping in the Pawn is absolutely fine.

capture.png (20.4 kB)
(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