How to create Context based UI elements

Aight if you right click on the Return Value output of the Create widget node you’ll get an option to Promote to variable. This will create a widget variable that will show up in your variables window which is by default on bottom left, and automatically connect a Set “YourWidgetVariable” Node.

300364-screenshot-1.png

If you drag that variable from the window to your event graph you’ll get the option for getting a “Get” or a “Set” node.

300365-screenshot-2.png

By default the widget variable is empty, so thats why we have to set it after creating it.

You can right click on the pin of a Get “YourWidgetVariable” Node to convert it to a validate get.

300366-screenshot-3.png

Something wrong in my initial example. So for the top chain the Validate get Menu widget is there to say: If a menu widget does NOT exist already, create one. So we drag from Is not valid. The bottom chain is: If a menu widget does exist, remove it. So there we drag from valid.

Hope that clears some stuff up!
If its not working you might want to debug parts of this just to see exactly Where its not working. I’d recommend putting Print strings at both ends of the Cast node just so you can check whether the hit result does detect your player character. If not, then you may need to change some collision settings on him.

300368-screenshot-5.png