# Input lag when creating and removing widget button (Also can break player's input and potential memory leaks)

**URL:** <https://forums.unrealengine.com/t/input-lag-when-creating-and-removing-widget-button-also-can-break-players-input-and-potential-memory-leaks/2016748>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, bug-report, fortnite\
**Created:** [September 11, 2024, 7:43pm UTC](https://forums.unrealengine.com/t/input-lag-when-creating-and-removing-widget-button-also-can-break-players-input-and-potential-memory-leaks/2016748 "2024-09-11T19:43:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![UselessMouth](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/uselessmouth/32/976514_2.png) [@UselessMouth](https://forums.unrealengine.com/u/UselessMouth)\
**Post date:** [September 11, 2024, 7:46pm UTC](https://forums.unrealengine.com/t/input-lag-when-creating-and-removing-widget-button-also-can-break-players-input-and-potential-memory-leaks/2016748/2 "2024-09-11T19:46:41Z")

</div>

### My original thread with the issue:

> [@\[BUG\] Huge input lag when using UI widget buttons — Also you can break player inputs entirely](https://forums.unrealengine.com/t/bug-huge-input-lag-when-using-ui-widget-buttons-also-you-can-break-player-inputs-entirely/2015799):
>
> So if you create buttons through Verse code, like in [this tutorial](https://dev.epicgames.com/documentation/en-us/uefn/making-widgets-interactable-in-unreal-editor-for-fortnite), when you do something for button to appear, you wait almost 1 second (!) to be able to see and click the button. Same goes for button closing. When you click on a button for it to disappear you wait almost 1 second (!!!) before it disappears and player regains control of the character. I am 100% sure this huge lag happens because of these two functions: player\_ui.AddWidget() # and player\_ui.RemoveWidget() So I tried to use w…

### Additional old threads:

> [@Trying to change the InputMode := ui\_input\_mode.None](https://forums.unrealengine.com/t/trying-to-change-the-inputmode-ui-input-mode-none/1896799):
>
> Hi I am tying to create an interactable Canvas that can appear and disappear with 0 delay I am saving already the Canvas in a map and I use it every time I need it. The delay is pretty low, but I need it to be 0 Canvas:=MakeCanvas() set AllAgentsCanvasUI[Agent] = option{Canvas} The only way that I found to get a perfect delay is using the functions Canvas.SetVisibility(widget\_visibility.Collapsed) / Canvas.SetVisibility(widget\_visibility.Visible) the problem is, you can not change player\_ui…

> [@Does anyone else find Verse UI really slow?](https://forums.unrealengine.com/t/does-anyone-else-find-verse-ui-really-slow/1309552):
>
> I have been messing around with different UI to create a shop in FN. I originally created a widget and dialog device but that has a few issues. Firstly, you can’t really change anything about the UI at runtime. Secondly, we are stuck with an extremely low 6 buttons (5 if you want to take one out for a exit button). These issues led me to the terrible verse UI code. The benefit here was that I could create more than 6 buttons and bind them all. What I did not expect was just how slow the UI is. …

### Potential memory leak code to reproduce:

> <https://gist.github.com/MattRix/912fd98e498a3e653457986bd65e8f94>

---

_[View the full topic](https://forums.unrealengine.com/t/input-lag-when-creating-and-removing-widget-button-also-can-break-players-input-and-potential-memory-leaks/2016748)._
