Announcement

Collapse
No announcement yet.

Struggling to understand widget BP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    Click image for larger version

Name:	CastingFailed2.png
Views:	1
Size:	116.9 KB
ID:	1225942

    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

    Click image for larger version

Name:	CastingFailed.png
Views:	1
Size:	20.5 KB
ID:	1225943

    #2
    Originally posted by polydark View Post
    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.

    [ATTACH=CONFIG]150033[/ATTACH]
    Plug another return node into Cast Failed pin and False pin, in your branch node.

    Comment


      #3
      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.

      Comment


        #4
        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.

        Comment

        Working...
        X