Transfering Integer to widgets?

Hey guys,
Iam kind of lost and out of ideas how to set the text of a text block (Widget) to the same value as my Integer. Ive tried to set up a “Cast to” but with that i don’t know what to select as an object. This is the last step to finish my game please help guys!

You have two approaches to this:

  1. Make an event that sets the text as you want it that is being called from outside the widget and pass the int as a parameter.
  2. Make a variable inside the widget of type integer OR whatever actor that has the int. Give the widget a copy of the int or a reference to the actor which has the int you need and simply access the int or actor reference when you need to set the text.

HTH

My problem is to get the reference set up correctly. Would you be so nice and send me a few screenshorts?

You can pass the reference of the actor to the widget via a function or set it manually. For that to work, you only have to add a variable,of your actors type, to the widget.

Or at least tell me how to set up the reference?

Hi,

This is how you can do it;

Store your integer inside a cast-able blueprint.

Go to your HUD or any other blueprint and create your widget there.

Go to your widget, add a text block and select it. Under the content tab, bind it to a function. Follow my graph.

Cast to the BP you have stored the integer there (which is player character BP in my sample).

You are done.

Regards,