Hi guys!
If I use “Remove all Widgets”, the Touch Interface dissappear forever. Very easy to replicate in a blank new project. I found this behaviour a little strange to me since the Touch Interface doesn’t seems to be a UserWidget class. I would like to know it UE4 is intended to work like that or if there is a workaround since “Remove all Widgets” is very handy to my project.
Hi there, I have the same issue and I really like using “remove all widget” but it destroys the touch interface.
It seems that the default touch interface is somehow hardcoded and can’t be called again in runtime.
The way to remove all widgets of certain classes is to use
GetAllWidgetsofClass -> For Each - > Remove From Viewport
I contributed GetAllWidgetsOfClass to the Engine early in UE4’s development, and offered RemoveAllWidgetsOfClass as well, but Epic preferred people to make their own blueprint library to add this second node.
(must logged into your ue4-linked github account to see above links
#Design Idea For You
I make my own UUserWidget base class that I inherit all my game widgets from, so I can just call GetAllWidgetsOfClass on my custom base widget class, to remove all of my widgets at any time
So in Editor
Create-> UserInterface → Widget and just give it a name like MyBaseWidget
Then File → Reparent all of your widgets to this BaseWidget class / BP and then you can easily clear your UI at any time using GetAllWidgetsOfClass(BaseWidget) (All in BP)
Better solution is to just call the “Activate Touch Interface” blueprint node after you remove all widgets. That will turn the touch interface back on.