Is there any way I can make the bind variable update live in the editor? I even tried updating the variable on its Event Construct, but that doesn’t update in the editor either.
When you created the binding, as well as the variable that you’d like to use to change your text, did you go into your GetText function and connect your Button Text to the return node on that function? Here is an example of how I’ve set mine up, and the text is changing as intended:
Are you sure it updates both on the button widget and in the parent widget? I tried setting it up exactly like yours, but it still has the same problem. It updates correct on my button widget. But on my Menu widget that instances the new button widget. That doesn’t updates in the editor (but updates correctly in game).
In my test project, adding the widget containing the Text Block to another widget updated the text in both cases. It wouldn’t update in the editor because the value is not being updated until the game is played and the GetText() function is called.
So yours also doesn’t update in the editor just like mine? And there’s no way around that? Maybe some way to force the GetText() function to be called in the construction script or something?
The construction script is called when an instance of that widget is being constructed in the level, which would unfortunately not update it in the editor.
This thread is a bit older, but here is the answer I just stumbled uppon when looking up the same problem.
regards
Edit: After one day of work with the solution in the link, I came to a new problem using this methode. It does work, at least for what it is supposed to do, update stuff within the editor. But OnSynchronizeProperties() (see link) is also called at least once when the widget is created.This will call what ever it should Syncronize, e.g. the text of a TextBox. But the TextBox->SetText() function call will break the binding on the TextBox.Text. This is also stated in the documentation: Drive UI Updates with Events | Unreal Engine Documentation (at the bottom). Other property bindings keep working. A quick fix would be adding OnTick() to the parent class and call OnSynchronizeProperty() within the tick and thus would emulate the binding to a variable. This is to often? Bindings get called once or twice a tick anyway, see: Question on UMG binding's update - Blueprint Visual Scripting - Unreal Engine Forums
Not sure if this is good practice but for me, the solution was to explicitly set the properties of the widgets I wanted to see updated in the editor during pre-construct.
This is not perfect though as for some reason it will also prevent the binding to be changed at runtime. Use this only for properties you care to set up during the construction phase.