Changing dynamic widget buttons

Hi.

I use a 3D widget that the player can interact within the game world. For this purpose, the buttons are dynamically created in the widget which are needed in each case.

Changing the text by “set text” when it is clicked does not work.

How can I change the button text from e.g. Open - closed?

It seems the only way is to destroy the button and create a new one with the changed text in its place, but it can’t be the right way.

Is there a better way ingame to change the dynamic buttons in the game without using the above described method?

Thanks

Savage

Hi @Savagee25

You can bind the “text” to a variable, changing that variable of the blueprint will change the shown text,
So
I have my widget with only an image a button and some variable and some events, this is My_Btn_widget
inside another widget in “User created widget” you can add your own creation.
I am pretty sure you can create it via blueprint too.

So basically inside my master widget i have an array of My_Btn… every one have a text, and a varable binded to the text, Changing it i change the text of any button.

You can do it by changing the variable as suggested above or access the button’s text block directly. Both will work.

Normally, this works fine, show us how you do it and we’ll try to poke holes in it. A button changing its own text is rather trivial:

but.jpg

Ok thanks… that worked!