UMG Widget not remove from viewport

You are both times creating a new widget. One time you add it to the viewport and the second time you remove it (which has no effect because it’s not part of the viewport. You just created it).

Save your widget reference after you added it to the viewport in a variable and remove that one. That will do the trick.

I hope this helps



as stated above, I tried to remove the widget from viewport after pressing a keyboard key.

I use the same key to make the widget to appear on viewport and it works fine.
when I tried to press it again, the widget does not remove from viewport but mouse cursor is remove as intended.

it is really confused me because on paper, it should be working as intended.

the thing is, if I change the key button just for remove widget from viewport (lets say F key), the blueprint work. but I do not want to use different key for this.

I already tried consume inputkey option disable, but no different.

Is this a blueprint bug? if bug is there any workaround? I’m using UE 4.5.1

please reply, thank you.

very good explanation about the logic behind blueprint and now I know what cause the problem is.

Thank you very much for your help, It works