Download

UMG/GUI Issues

I seem to be having the weird effect that if a player starts my first level and then goes into the pause menu and clicks Quit (which brings them back to the main menu) they still have the HUD from in game and can interact with it (hi hit space to lose energy stat or left-click the mouse to have ammo count go down). Any ideas on how to fix this?

Problem:

http://dl.markyrosongaming.ar.nf/2015-07-18_2254.png

In game/level view of HUD:

http://dl.markyrosongaming.ar.nf/2015-07-18_2257.png

P.S.
I had to put up these images on my remote file server as apparently I run into database errors when I try to upload an image here or have this site retrieve it and reference it locally. Someone might want to take a look at that :wink:

Hey,

You need to remove it from parent. If you do not ‘destroy’ it it will always be there wouldn’t it? :slight_smile:

Apparently even if I load the main level first I have this issue.

No matter what I do I seem to be having zero luck fixing this though. If I do manage to get the HUD to disappear (which I have) from the main menu it does not appear once the user clicks ‘play’ and even if I am able to do that the sounds etc still play on the main menu. I am confused as to what I am doing wrong as I do call for it to be removed from parent and did before I even started trying to edit it etc.

Use the action 'Get all widgets of class" (or something like that) when you load the level and from there remove it.

Example: Load level 1. Event begin play (from level blueprint)-----> Get all widgets of class----> remove. (Reverse it if you want it to appear.)

I am confused. I did that but now the old hud is just unresponsive (only shows editor placeholders for it and does not colour it correctly etc for run time) and still does not disappear.

http://dl.markyrosongaming.ar.nf/2015-07-19_0915.png

http://dl.markyrosongaming.ar.nf/2015-07-19_0919.png

If it helps any, here are my blueprints. The links to the videos (dl.markyrosongaming.ar.nf/VIDEO_NAME.swf) are safe, only reason the video does not appear like the video is that I guess phpBB does not support .swf videos.

MainMenu level blueprint:
[video]http://dl.markyrosongaming.ar.nf/2015-07-19_0921.swf[/video]

HUD blueprint:

http://dl.markyrosongaming.ar.nf/2015-07-19_0930.png

MainMenu blueprint:
[video]http://dl.markyrosongaming.ar.nf/2015-07-19_0932.swf[/video]

FirstPersonExampleMap (map/level loaded when Play button on main menu is pressed):

http://dl.markyrosongaming.ar.nf/2015-07-19_0935.png

From a quick look why do you create and destroy in the same tick (event begin play) the widget? The UMG is already there so just kill it in the event begin play. No need to re create it Give it a try.

Which blueprint are you referring to?

The level bp

I am not creating and then destroying it to my knowledge. I am creating the MainMenu UMG and destroying the in-game HUD UMG (which doesn’t really work in the sense that the in-game HUD still is hanging around no matter what I do).

Question…Are all of the widgets for your main menu hud on the same widget as the progress bars? If so, are you dealing with nested widgets? If that is the case, try removing each one separately in a reference chain (progression bar 1>remove from parent>progression bar 2>remove from parent(or change visibility)). I ran into that myself recently, and doing this worked.

no, they are totally different blueprints

hey man, maybe i missed that, but which class does the creation of your widget?

You did not miss that and thank you for catching this. I forgot to include this one screen-capture of the FirstPersonCharacter Blueprint (or rather the part relating to this topic). In fact, the very existence of the FirstPersonExampleMap level blueprint does not effect the HUD (not) functioning and does not appear to be needed by anything.

[video]http://dl.markyrosongaming.ar.nf/2015-07-20_0915.swf[/video]

This is the tutorial that I originally was following and since reset everything to so that at least the HUD works for now, even if it can be accessed and the shoot sound still plays in the main menu when you click. AnyNy ideas why they did not have this issue?

Hi there,

so how can you be sure that they dont have the same issue? i just see a little video with way too much nodes inside the event graph.

I can only recommend to use more custom functions in blueprint to avoid such heavy blueprint node spaghettis.
The next thing is i wouldt create any widget inside a character class, except for widgetcomponents, since i feel they belong more to a controller (since they need a PC reference) than to a character.

However there are many ways to create a widget at way too many different classes fmpov but nvm :wink:

Your issue may be related to the workflow during level transition, since everytime you load a level all of your actors in your world even gamemode and gamestate will be reset. (to keep things persistent, epic has invented the
wonderful gameinstance class) but back to your issue.

Since your controller, character a.s.o are reset, they run their whole construction, beginplay stuff again. Your widget will probably be created again and are added to viewport, it doesnt matter if you removed them in the old level.
I cant give your “THE” solution because i dont know your game nor your game design (have you ever read about design pattern? If not, its a very good advise to do so).

A solution could be that you use the gameinstance to create your widgets, which widget it creates depends on the level which was loaded.

So inside a BP derived from gameinstance (and set up to default in Project settings).

There can be a function called f.e. CreateWidgetForLevel, with an input text, enum or whatever to tell the gameinstance which level is actually valid.
Then inside the levelblueprint of your level call GetGameInstance->Cast to CustomGameInstanceBP->Call CreateWidgetForLevel(“LevelName”);

Lets say it was the MainMenu level calling.

GameInstance will Create Widget of MainMenu (he needs the GetPlayerController for this), the output will be saved in a variable inside gameinstance.

When a new level shall be loaded, you´ll need to remove the current widget from Viewport (Remove from Parent). You HAVE TO make sure that this happens when the old
level is still valid (I think there was an OnEndLevel Event or something), inside such a function call the GameInstance again and tell it to remove all its stored widget.

For this create another CustomFunction f.e. ClearWidgets()-> take all your widget references it has and call “Remove from Parent”.

I may miss something, since its from the depth of my head :wink:

Happy blueprinting :smiley: