So if you create buttons through Verse code, like in this tutorial, 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 widget.SetVisibility(widget_visibility.Collapsed)
and I got rid of the input lag, but it breaks player inputs entirely (unless I remove the widget button with player_ui.RemoveWidget()
).
So the obvious workaround for widget to have no lag is to create it in some init stage, like at the game start, and just show/hide it when you need to, BUT you can not change InputMode
of the widget after its creation!
All of this can be solved, if we could somehow change ui_input_mode
of the widget after widget creation, so I could give player control when he needs to.
Right now you can only set ui_input_mode
in player_ui.AddWidget()
stage and thatβs all.
I am not the only one with this problem: