Widget Value

How can I set a widget’s output value? The widget displays a text box but I cannot get the value for the widget to show in the text box.

The value I am trying to put in is from some nodes → SET(variable name)
but I cannot implement this variable into the widget text box.

I get the error Binding Property’ Text Delegate ’ on Widget ’ EditableTextBox ': Member Variable has no return value, unable to bind.

The text box is for the displayed text only - not the variable name:

Try this tutorial:

can you upload picture ? It’s very difficult to understand and it would be great if you add the comments .

Inside my level blueprint, I create the widget and hook it up to an EventBeginPlay.
Above the nodes for creating and setting visibility to the widget, are the nodes for my variable.

This variable is just the distance between the player and a TargetPoint. I set the z value of this distance to the “Set” for the variable Score.

Inside my widget blueprint is just text displaying the word “Score”, along with a text box upon which I would like my variable Score (the z distance) to be displayed in.

Inside the content binding which I named “Score” are the nodes for the content of the new binding “Score”. I cannot however get my variable Score (which is in the level blueprint) to enter the widget event graph, to set the Score (z distance) to the return value of the return node.

I have looked into each section of the documentation, but nothing will solve my problem. I just cannot find a way to set my variable to the text box of my widget.

I tried following along with the hud/health/ammo hud tutorial (mainly ammo b/c it displayed a value, not a progress bar . . . but I could not implement my variable like what was shown in the tutorial w/ the ammo variable (which had a target module AND a value module on the variable)

Ok. Let’s fix this. Just remove that binding on your textbox.

1.Add your widget different function “score change” , which will set textboxs text and which takes float on argument.
2. On begin play save reference of your widget like this and call “showWidget”

  1. Then add event tick your level blueprint , which will call “score change” on “showWidget” reference.

If this will not work answer me and i will make tutorial with pictures

This is how I set up my level blueprint. I have removed the binding, but my text box remains blank.

When controlling my player, I can click inside the text box and type in anything. Is this how my text box should be set up when trying to program it to a float? Or is it just my calculation of the variable or the way I used the SET node that is not appropriately setting my variable?

Because you haven’t saved reference. you need to create widget just once on start. Do what i showed in my first picture and answer

How can I create a reference of my widget and what will this do for the variable? I have a create widget like yours but my widget event graph is empty, so I do not know if referencing the widget will do anything with my current setup since I already have a createWidget connected to my EventBeginPlay.

It’s easy , level blueprint add variable , Type: Your_Widget and Name : “MyWidget” and after making widget, set value to it, like in picture. After this you dont need to make widget in event tick, just you will use reference on it. I will show you how to do this after you do first part.

Is this reference the “SET Pick Up Widget”? My variable is not compatible with my Create Score Widget.

Post picture please and also write what type is your variable.

I’ve tried int, I’ve tried float, I even set it to reference of different widget types.

I did find this SET text box value tho, I just am unsure of how to connect my distance nodes to it.

I might have done what you intended…I right clicked the return value on the widget, promoted to variable, and attached it to the wiget and addToViewport.

There is not a spot for the distances nodes to connect to.

No not float. you need to create variable of your widget. Click on create score widget-> return value and make promote to variable like this. And it gives you reference of your widget.

1.this must be done on event begin play.

2.Now on event tick you must call change score function on this reference.


Like so? Change score function is not a function but my “SET MyScore” variable (widget promoted variable)
I do not have an asset to select so I’m figuring this is the wrong node. I understand what the Set will do…it will update the value before setting to viewport. But how EventTick can edit the value for this set variable I am unsure of b/c when I drag the variable out and hit set, it asks for an asset which I do not have available

add your widget public function which will change textboxs text.

Alright this is where I’m at

How can I connect my variable float to this set text box?

Let’s do this step by step.

  1. On Level blueprint make your widget and save reference “Level Blueprint”

  1. Add your widget blueprint function change text like this. “Your Widget”

  1. Add event tick function to your “Level Blueprint”

And result will be this.