# RemoveWidget Extension not working?

**URL:** <https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441>\
**Category:** Verse\
**Tags:** unreal-engine, unreal-editor-for-fortnite, editor, Widget, question, fortnite\
**Created:** [August 24, 2024, 7:05pm UTC](https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441 "2024-08-24T19:05:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Z3bush](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Z3bush](https://forums.unrealengine.com/u/Z3bush)\
**Post date:** [August 24, 2024, 7:05pm UTC](https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441/1 "2024-08-24T19:05:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Proxying](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Proxying](https://forums.unrealengine.com/u/Proxying)\
**Post date:** [August 28, 2024, 12:06am UTC](https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441/2 "2024-08-28T00:06:49Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![Flak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flak/32/769441_2.png) [@Flak](https://forums.unrealengine.com/u/Flak)\
**Post date:** [August 28, 2024, 12:16pm UTC](https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441/3 "2024-08-28T12:16:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DustinREDGames](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dustinredgames/32/634988_2.png) [@DustinREDGames](https://forums.unrealengine.com/u/DustinREDGames)\
**Post date:** [August 28, 2024, 2:51pm UTC](https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441/4 "2024-08-28T14:51:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sonictke](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sonictke/32/924209_2.png) [@sonictke](https://forums.unrealengine.com/u/sonictke)\
**Post date:** [August 28, 2024, 10:00pm UTC](https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441/5 "2024-08-28T22:00:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![doctorpepperdan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@doctorpepperdan](https://forums.unrealengine.com/u/doctorpepperdan)\
**Post date:** [August 29, 2024, 1:16am UTC](https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441/6 "2024-08-29T01:16:12Z")

</div>

Tried calling a destruct on widget?

---

<div class="post-metadata">

**Author:** ![Behzad993](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Behzad993](https://forums.unrealengine.com/u/Behzad993)\
**Post date:** [September 11, 2024, 4:56pm UTC](https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441/7 "2024-09-11T16:56:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![0xrhsmt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@0xrhsmt](https://forums.unrealengine.com/u/0xrhsmt)\
**Post date:** [September 18, 2024, 2:40am UTC](https://forums.unrealengine.com/t/removewidget-extension-not-working/1990441/8 "2024-09-18T02:40:58Z")

</div>

Same.
