Struggling to understand widget BP

Hey everyone

I have a bool “GotRevolver” on my PlayerBP that tells me if i have collected a revolver or not.
I have a image element on my UI widget that displays an icon of the revolver.

I want the UI widget to only display the icon if GotRevolver == true

but i am struggling to get it to work, i have selected to Bind the “Brush” detail in the UI designer and in the created function i am trying to cast to the PlayerBP, get GotRevolver and if it == true i am trying to set the Brush Image to the my revolver icon by making a new slate brush struct. But it keeps saying execute path is not connected to a return node although it is.

i have also tried using the SetBrushToTexture node but it does not have the correct return value for the return node and i have nothing to plug into the Brush node


Plug another return node into Cast Failed pin and False pin, in your branch node.

Thank you Gbr, it is working!

I was trying to think of a way to plug CastFailed/False into something but didn’t realize i could duplicate the return node.

Every function needs to end with a return Node. Void(No return value(s)) functions not necessarily.
If you don’t do it, the result is probably unexpected.

You can also use Right Click -> Add Return Node instead of duplicating existing Return nodes.