Hey there!
I may have found a bug utilizing UMG and Widget Switchers. When I call a child blueprint in a widget switcher, variables in the child don’t tend to update. If I call the said child widget by itself (outside of the widget switcher) it works just fine. Is this a bug or am I missing a way to update/reload the widget switcher? I’m using the latest engine, 4.11.1. I was working on my primary project in 4.11 when I encountered this issue, so I updated to 4.11.1, but the issue persists.
I’m not the greatest at explaining things, so I created a video from a blank project reproducing the steps in 4.11.1: - YouTube
Here’s what I did in the video:
- Created a blank project (to show it’s reproducible outside of my project).
- Created two widgets: Options and GameplayOptions.
- Opened GameplayOptions, created a text component, did a bind of the text content.
- Promoted the Return Value to a variable. Typed “HELLO” into the variable.
- Opened Options, created a widget switcher, then added the GameplayOptions widget as a child.
- Opened the level blueprint, created Options widget (the widget with the Widget Switcher inside of it), added to viewport.
- Played game to show that the variable text is correct (shows “HELLO”).
- Quit game, went to the GamePlayOptions widget, changed the variable from “HELLO” to “MY NAME IS STEVE”, compiled & saved, ran the game again.
- This time, the variable doesn’t update (still shows the old “HELLO” text, when it should be showing “MY NAME IS STEVE”).
- I then went to the level blueprint again and changed the widget to the GameplayOptions widget and played again to show that indeed, the variable is updating in its own widget, but not when it’s shown through the widget switcher.
- I then demonstrated again by changing “MY NAME IS STEVE” to “THIS WORKS” (still leaving GameplayOptions as the created widget in the level blueprint) and that updates fine.
- Finally, I went back into the level blueprint and changed it back to Options and it incorrectly shows “HELLO”, which is the very first text I typed into the promoted variable.
Hopefully my explanations are clear. I’m not sure if it’s a known bug or not, but it seems like the widget switcher doesn’t “see” updated variables from its children.
Thanks for looking into it!
-Kyle