# Transfering Integer to widgets?

**URL:** <https://forums.unrealengine.com/t/transfering-integer-to-widgets/396314>\
**Category:** UI\
**Tags:** cast-to, integer, unreal-engine, editor, Widget, question, Blueprint\
**Created:** [June 18, 2017, 2:29pm UTC](https://forums.unrealengine.com/t/transfering-integer-to-widgets/396314 "2017-06-18T14:29:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brohst](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brohst](https://forums.unrealengine.com/u/Brohst)\
**Post date:** [June 18, 2017, 2:29pm UTC](https://forums.unrealengine.com/t/transfering-integer-to-widgets/396314/1 "2017-06-18T14:29:02Z")

</div>

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!

 ![190826-q^1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/5/df59d8ab45ee260c375496c7f093d2e716a1b706.png)

 ![190827-q2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/0/5/005c3f969741efd0d05d6915e2ff9918cc9d957b.png)

---

<div class="post-metadata">

**Author:** ![NoobsDeSroobs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NoobsDeSroobs](https://forums.unrealengine.com/u/NoobsDeSroobs)\
**Post date:** [June 18, 2017, 2:49pm UTC](https://forums.unrealengine.com/t/transfering-integer-to-widgets/396314/2 "2017-06-18T14:49:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brohst](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brohst](https://forums.unrealengine.com/u/Brohst)\
**Post date:** [June 18, 2017, 4:10pm UTC](https://forums.unrealengine.com/t/transfering-integer-to-widgets/396314/3 "2017-06-18T16:10:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brohst](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brohst](https://forums.unrealengine.com/u/Brohst)\
**Post date:** [June 19, 2017, 11:35am UTC](https://forums.unrealengine.com/t/transfering-integer-to-widgets/396314/4 "2017-06-19T11:35:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MatzeOGH](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MatzeOGH](https://forums.unrealengine.com/u/MatzeOGH)\
**Post date:** [June 19, 2017, 1:18pm UTC](https://forums.unrealengine.com/t/transfering-integer-to-widgets/396314/5 "2017-06-19T13:18:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![navid100](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@navid100](https://forums.unrealengine.com/u/navid100)\
**Post date:** [June 19, 2017, 1:50pm UTC](https://forums.unrealengine.com/t/transfering-integer-to-widgets/396314/6 "2017-06-19T13:50:40Z")

</div>

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.

 ![200843-hud.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/2/b/72bba12551cc750799f3a27cfce9536d1c090155.png)

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).

 ![200845-widget+function.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/6/ec62a3d0770df880c0ccca74155eab1796917ebb.png)

You are done.

Regards,

---

<div class="post-metadata">

**Author:** ![Scolyisnotaloli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Scolyisnotaloli](https://forums.unrealengine.com/u/Scolyisnotaloli)\
**Post date:** [October 6, 2024, 11:00am UTC](https://forums.unrealengine.com/t/transfering-integer-to-widgets/396314/7 "2024-10-06T11:00:34Z")

</div>

Helped me out so much man thank you much appreciation
