Binding a Text to Text Block

So, I have made a Widget which starts at the beginning and where I can write into a text box.

On committing Text the level is changing and another Widget is showing where I have placed a Text block.

So my plan is now that the content of the committed text before is now showing as the text block.

I know that I can create a binding to that text but for some reason it’s never showing up when I try to create a new
Variable (Text) and connect it to the OnTextCommitted Event.

I tried to make it on my own logical way but it looks like im missing something.

I appreciate every answer I can get!

Ok i am not an expert but i think you could do it this way.

First on the widget where you want to show the text that you have entered create a Text Variable and set it so that editable and expose on spawn to checked.

101890-texttobedisplayed.jpg

Next bind your text on the widget to that variable:

101891-binding.jpg

Now you need to set the text in the widget with the textbox as shown below. After you set the text and change level you can then create your other widget which has the option to set the “TextToBeDispalyed” which you want to set to “EnteredText”. This option is available since you set editable and expose on spawn to checked earlier.

EDIT: You might need to add “Add to Viewport” at the end of that.
Hope this helps!

1 Like

Seems to work, thank you for your help.
But looks like the Widget just pops up for like a second and then it’s getting removed because of the level change and it’s not valid anymore I guess.

Nope that’s not working :confused: But thank you anyway.

You could try adding a delay between the open level and the create widget?

The way that UE4 normally works everything that exists in the UWorld- represented by your level, gets torn down upon changing the level. That means player controllers, pawns, HUDs, widgets, everything that inherits from AActor or that is reliant on an actor to keep track of it’s existence. Thankfully, there are a couple of ways around this, the simplest being using the UGameInstance class, which inherits from UObject, not AActor.
So if you wanted you could create a variable on your GameInstance to store your text using Swift_MJ’s example but keeping the variable on the GameInstance.
Then when your new level is loaded, use that stored variable to get the name back into the world on a new widget.
This is just one way of doing it, there are a few but this is definitely the easiest.
Hope this helps!
-Spiris

Yeah, it works perfectly now!
Thank you very much for your explanation!