RemoveWidget Extension not working?

Hello everyone! I’ve been having issues with the RemoveWidget extension when trying to remove any type of UI from the players screen. The AddWidget Extension works perfectly fine but, for some reason why the RemoveWidget is being buggy. I’ve learned that RemoveWidget will sometimes work depending on how you write the code. However if you wring your function like:

FunctionName(Agent:agent):void=

#TextBlock
#CodeHere
Inventory : canvas = canvas:
Slots := array:
canvas_slot:
#CanvasSlotInfo
if(ExitCanvas = true):
PlayerUI.RemoveWidget(Inventory)
else:
Print(“Player Has not exited yet”)

When you write your code like that ^ then the RemoveWidget will not work. But if you write your code using a tuple for the canvas then it will work.

So my main question is that is this being fixed and, is anyone else having this bug. If anyone has a work around that does not use a tuple and allows me to write the code like this can you please let me know. Thanks!

Using:
Unreal_Editor_For_Fortinte

1 Like

Afaik theres no “fix” for the issues with RemoveWidget, it seems to be failing on a per-client basis (maybe due to ping or packet loss?). Any time I call RemoveWidget now (with the intention of the widget actually being removed, I call the following line on the widget prior to removal. This seems to work/workaround the non-removal of the widget while we wait for a fix upstream.

.SetVisibility(widget_visibility.Hidden)

Thank you, we’ll get someone to take a look.

I’ve also been dealing with this issue and using the same SetVisibility(widget_visibility.Hidden) work around.

But beside having this fixed, I would also like to see a RemoveAllWidgets method added to player_ui. That way we have a way to clear all Verse UI on a player.

Right now with this bug, after I call RemoveWidget I no longer have a reference to the widget anymore and have no idea if the RemoveWidget call worked or failed. With a RemoveAllWidgets method, I can wipe everything, without needing widget references.

Hi @Z3bush and @DustinREDGames:

Does this happen also when in a playtest session (i.e. when you click Launch Session from the UEFN editor)? Or is this only manifesting on clients in published experiences? If it happens in the former, could you provide the editor logs when the issue manifests as well?

Tried calling a destruct on widget?

Hi I have the same issue and it’s accruing in the playtest session as well as in the private version.

Same.