How get/change Text child of a Widget (component) that is in another Blueprint Actor

I think this is a basic question but idk how to get children when dealing with Widgets in non UMG blueprints. Please give picture help. Ty.

  1. I have a weapon Blueprint that contains the static mesh, and a widget component (as a placeholder).

  2. And this widget component is selected to use a Widget that has a Canvas Panel and Textblock that says “Tier X.”

  3. I will have random weapon spawns, so I made a Struct that sets a weapon’s properties like its Tier #.

  4. I want the Struct to be read by the WEAPON BP, and set the Text block of the widget (in the Weap BP) - to the new Tier value (string). How do I do this?

  5. I also set the Weapon BP and Widget BP to use the same BluePrint interface (BPI), which has a Function with an output String, the Function which I’d call in the Weapon BP > to talk to the Widget BP.

Here’s the code in my Weapon BP so far. It doesn’t work to get and set the Tier X string (default value of “Tier 1”) from the Struct.



  1. I’m confused because I watched a vid made in 2021 (UE 4.26?). The guy was able to open the Widget UMG actor.

  2. And in Design mode, he clicked the Text box > then at Bind, he was able to click the Dropdown box and it said Create Binding (Function) or Properties > “Text Overlay” [set the text as a real variable in the Graph tab]. But my UE4.27 does not show the option to Bind > Properties > “Text Overlay.”


  3. Then he was able to “Create” his widget in the BP of another actor, and it automatically had an Input node of “Text Overlay” (string) to plug into and change the value.

getWidgetRef
Get Reference to the widget like so. You can then use the widget as usual.

2 Likes

Thanks so much for that pic. I got the ref and almost got it to work.

  1. See pic 1, the code in the red shape does not work. Know why?

  2. See pic 2. It references code in a Function in the Weapon BP, which calls a linked Blueprint Interface (which has no code, only sets up the output variable nodes).

  3. But when I put the same code (from the Function) in the main graph (see Pic 1, green box), the code now works to get and display my “Tier X” string (that is in the Struct).

(So 1 method works. But I’d like to know how to get the BPI method to work, since I’ll need to use it more for addons.)

Ty

Not sure what the issue there is but you can try printing values in the interface function to see if it is returning as expected

1 Like

Thanks. I’ll mark Q1 as solved.
If anyone can add, please answer how the other guy was able to set variables in UMG > see Second pic set @ “I’m confused”

1 Like