I’m getting inconsistent behavior in a scroll box widget for the children widget visibility. Sometimes they show, sometimes they don’t. I’m debugging the logic and it seems there is “something” else driving the visibility that is not the SetVisible function as there is an inconsistency between the isVisible and getVisibility functions.
See screenshot below - i’m getting all children (i checked and it has the correct number of children of the correct class) and explicitely setting visibility to Visible. When running the project, the IsVisible function returns false while the getVisibility function is returning Visible. Any idea how to get this resolved and if there is a different way i can force the visibility to true?
I’m not entirely sure that IsVisible() is something you want to use with widgets. It has nothing to do with ESlateVisibility parameter (Visible, Hidden, Collapsed, etc.).
The underlying code of IsVisible() is return FullScreenWidget.IsValid();, where FullScreenWidget is TWeakPtr<SWidget> FullScreenWidget;
I don’t know exactly what it is, but I assume that IsVisible() shows if widget is actually being rendered, not its ESlaleVisibility state.
If someone has a bit more in-depth information about it, I’ll gladly hear it too.
thanks! Funny enough the “isVisible” result (true or false) is 100% aligned with me actually seeing the Widget in the game or not. Can you think of any reasons why a widget would not be shown while the GetVisibility returns “Visible”?
I check visibility of the parents, but there is no problem (both getVisibility = Visible and isVisible = true).
Hard to say, depends on the setup; Maybe if render opacity is set to 0, or the element is on inactive Widget Switcher tab, etc. There can be various setups where an element’s ESlateVisibility is set to Visible, but this element does not show on the screen.
Where can i find more information about this isEnabled function? Not sure how i can access the underlying code?
I checked and the parents of this widget (up to 4 levels up the hierarchy) all have the same situation. IsEnabled shows false, while initially it shows true - so something must have updated it, even though the exact same logic is called a second time.
Problem and solution found - i created several versions of the “root widget panel” (every time button was pressed). In my case, the widgets that were not visible were still on the “old widget panel”.