Hey, we are using 4.8.2 and I wondered…
- How to use menu anchors?
I tried adding a Widget I wanted to spawn in the “MenuClass” variable of the Menu Anchor, and called “Open” on that Anchor but there’s no way to “Get” the spawned widget as a “MyGameWidget” so I could access it’s variables and use functionality of it.
- How to use named slots?
I added a variable name to it and ticked IsVariable checkbox, then tried adding a child to it using AddChild, but the child couldn’t be clicked or interacted with. The other possiblity I thought this widget was used for was when you extend off a widget blueprint, so chlidren can put different functionality in the same place, which leads to number 3…
- I cannot extend off a widget and use it as expected.
Issue 1 - No visible widgets appear on the designer view of the child widget blueprint (I expected, like actor blueprints, that you could ammend parent components or at least use them, leading to the second point…)
Issue 2 - Although I appear to have variables from the parent widget, none of them are initialised and seem to be invalid and unusable, throwing errors and simply doing nothing when I try to access them.
- Off that topic now, I wanted to check what the standard was you expect UMG to be implemented.
I am still using A_MyGameHUD, which on BeginPlay create a MyGameUMGHUD Widget, adds it to the viewport.
The MyGameHUD extends off MyGameHUD.cpp and all the functionality is done there or in A_MyGameHUD. I then, in the Widget HUD blueprint, have a Custom Event for every single event the A_MyGameHUD gets.
For example my character loses a bit of health, this is passed from MyGameCharacter.cpp to MyGameHUD.cpp, which calls a BlueprintImplementableEvent in the A_MyGameHUD blueprint, which calls a Custom Event in the MyGameUMGHUD Widget blueprint, which then sends a Custom Event or function call to the Healthbar.
This feels a bit long winded to add for every bit of new functionality I make. I wondered if it was expected the main hud would be set to a widget blueprint, skipping the AHUD altogether, or any other step I may be missing.
Thanks for any help.