how to connect the value of a textbox in an ui widget to text render in actor class

I’m trying to connect my textbox to a text render so that whatever i type in the textbox is put in the content value in the text render component

To connect a TextBox to a Text Render component in Unreal Engine, you’ll need to use Blueprints to handle the input from the TextBox and update the Text Render component accordingly. Here’s a step-by-step guide to achieving this:

  1. Set up the TextBox:
  • In the Unreal Editor, create a new User Interface Widget Blueprint.
  • Add a TextBox widget to the canvas of your Widget Blueprint.
  1. Set up the Text Render Component:
  • In your level or blueprint, add a Text Render component to your scene. You can place it where you want the text to be displayed.
  1. Create a Blueprint for the functionality:
  • Create a new Blueprint Actor or a new Blueprint Widget that will contain the logic for updating the Text Render component.
  1. Create a Variable:
  • In your Blueprint, create a variable to store the Text Render component you want to update. In the Details panel, change the variable’s type to TextRenderComponent.
  1. Bind TextBox Event:
  • In your Blueprint, select the TextBox widget, and in the Graph editor, right-click to create a new event for “On Text Changed.”
  • Connect the “On Text Changed” event to a custom function.
  1. Create Custom Function:
  • Create a custom function in your Blueprint. This function should take a string input, representing the text you want to update in the Text Render component.
  1. Update Text Render Component:
  • In the custom function, update the content of the Text Render component using the string input provided.
  • To do this, you can use the “Set Text” node and connect it to your Text Render component variable.
  1. Bind TextBox Event to Custom Function:
  • In the Graph editor, connect the custom function you created in step 6 to the TextBox “On Text Changed” event.
  1. Set up the Blueprint in the Level:
  • Drag and drop your Blueprint Actor or Widget into the level or parent blueprint containing your TextBox and Text Render component.

Now, whenever you type something in the TextBox, the custom function will be triggered through the “On Text Changed” event, and the content of the Text Render component will be updated accordingly.