My HUD contains the Player Controls, Main Menu, Pause Menu and Level Failed Dialog.
I am trying to make it so that when the Character Hits or Collides with an object, the HUD displays the Level Failed Dialog, but when the Character does Hit the object, the Player Controls stay on the Screen as well as the Level Failed Dialog.
How do I get the Player Controls to disappear or Set Visibility to Hidden from another Blueprint?
Do I Cast? or Set a Boolean?
Got to your widget BP and select your component that you want to set its visibility. Under the Behavior tab, bind the visibility to a function then open up the function and follow my graph;
The other approach is to instead of binding visibility, try to set it from your character BP by a simple cast to. Note that in order to cast to a widget, first you should have created that widget inside a HUD and promoted it to a varibale, otherwise you can’t access your widget components.
Set the variable to ‘Hidden’ or ‘Collapsed’. You can use a delay node after setting it to visible to set it back to collapsed or use an event to do that. It’s up to you and depends on your game logic.
Typically you should refer one variable to one widget component. If you have different widget components with different visibility settings, then yes you should assign a variable to each of them. But if different components have same visibility settings, then you don’t need more than one variable for them. You also need to bind each widget component visibility to a new function if you want to assign a different variable to them.