Download

Hide / Show Widget

Using the Blueprint editor, how would I hide and show a widget depending if it is enabled or not?

Some of my widgets are sharing screen space and will alternate being enabled or disabled depending on game flow. Also, Boolean variables are used to set the widget state (enabled or not), which I’d like to tie with visibility or hidden. Would you mind pointing me to documentation, or listing instructions on how to perform this task.

Thank you in advance for your help.

in the widget set “is visible” to true or false to show or hide it

Thank you NDFJay for the response.

In the designer I am able to set the widget visibility to one of the following: [Visible, Collapsed, Hidden, Hit Test Invisible, Self Hit Test Invisible].

I see no method that takes a Boolean, either in the dropdowns nor the “Set …” type nodes. I am, however, able to expose a ESlateVisibility variable from my C++ class and “Bind” to it in the Blueprint Designer, but changes to the ESlateVisibility variable does not seem to affect the widget at runtime.

Seems they changed a few things, you could always create a function on your character class or game instance, something castable and use that to change your widget visibility, for the sake of this I’ve done it all in my level blueprint.

Set visibility function

Calling the function

Wow. Thank you NDFJay.

I’m now using an event notification that returns the visibility state, and for the most part it works reasonably well. However, your approach above will be usable in other areas.

Thank you again :slight_smile: