Quantcast
Channel: General - Epic Developer Community Forums
Viewing all articles
Browse latest Browse all 9593

Cannot change UI visibility immediately after calling AddWidget

$
0
0

When a UI is created, the visibility behaviour becomes herratic, refusing to hide, unless hidden in a very specific way.

If you run the code:

PlayerUI.AddWidget(MyCanvas)
MyCanvas.SetVisibility(widget_visibility.Hidden)

the UI will not hide

If you run

PlayerUI.AddWidget(MyCanvas)
Sleep(0.0) #Sleeps 1 server update
MyCanvas.SetVisibility(widget_visibility.Hidden)

it will also not work

Instead, running

PlayerUI.AddWidget(MyCanvas)
Sleep(1.0)
MyCanvas.SetVisibility(widget_visibility.Hidden)

will work!

And finally, just cause we can’t have nice things in life, if you run

PlayerUI.AddWidget(MyCanvas)
loop:
    MyCanvas.SetVisibility(widget_visibility.Hidden)
    Sleep(1.0)

The UI will not hide, and will ignore any external attempt to hide it, unless the external attempt is specifically

MyCanvas.SetVisibility(widget_visibility.Visible)
MyCanvas.SetVisibility(widget_visibility.Hidden)

Which is quite funny if you ask me

I think this issue appeared within the past 2 updates, as that’s when I started observing this fun fun behaviour. Please help.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 9593

Trending Articles