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
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