# How can I display the value of variable on the screen?

**URL:** <https://forums.unrealengine.com/t/how-can-i-display-the-value-of-variable-on-the-screen/369237>\
**Category:** UI\
**Tags:** Variable, hud, set, text, unreal-engine, Blueprint, question\
**Created:** [September 3, 2016, 4:08pm UTC](https://forums.unrealengine.com/t/how-can-i-display-the-value-of-variable-on-the-screen/369237 "2016-09-03T16:08:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakubinioo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jakubinioo](https://forums.unrealengine.com/u/Jakubinioo)\
**Post date:** [September 3, 2016, 4:08pm UTC](https://forums.unrealengine.com/t/how-can-i-display-the-value-of-variable-on-the-screen/369237/1 "2016-09-03T16:08:36Z")

</div>

Hi! I try to display value of variable GOAT\_SAVED from “cage” BP on the screen on HUD but I don’t know how to do that. I tried many ways but nothing works. 😕

 ![105547-bp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/a/63a802b6666447dcd259600006b4d58e482a582d.png)

 ![105548-bp2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/d/3/fd3790245feb293cd063e7e2966e6ade884624ff.png)

---

<div class="post-metadata">

**Author:** ![mdonge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mdonge](https://forums.unrealengine.com/u/mdonge)\
**Post date:** [September 3, 2016, 9:06pm UTC](https://forums.unrealengine.com/t/how-can-i-display-the-value-of-variable-on-the-screen/369237/2 "2016-09-03T21:06:16Z")

</div>

First, your widget blueprint need a reference to your actor (where the variable is).  
the easiest way : when you spawn the widget, you can set the owner of the widget, then in the widget you can use “get owning pawn” …

Good luck !

---

<div class="post-metadata">

**Author:** ![Jakubinioo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jakubinioo](https://forums.unrealengine.com/u/Jakubinioo)\
**Post date:** [September 4, 2016, 8:53pm UTC](https://forums.unrealengine.com/t/how-can-i-display-the-value-of-variable-on-the-screen/369237/3 "2016-09-04T20:53:56Z")

</div>

Thanks for answer. When I try to set owner and then compile and play, I have this error.  
Can you show me how to do that? I’ ll be very thankful 🙂  
105663-

---

<div class="post-metadata">

**Author:** ![aristides](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@aristides](https://forums.unrealengine.com/u/aristides)\
**Post date:** [September 4, 2016, 11:53pm UTC](https://forums.unrealengine.com/t/how-can-i-display-the-value-of-variable-on-the-screen/369237/4 "2016-09-04T23:53:18Z")

</div>

Store your variable someplace where you can get access to it. I store them in my GameMode blueprint (I know it might not be the best place). Then bind a blueprint to the text field in your widget.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/d/e/de7227edd09e59512039fd6252a0761eca4cbb28.jpeg) ](https://i.imgur.com/5WEB36V.jpg)

---

<div class="post-metadata">

**Author:** ![mdonge](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mdonge](https://forums.unrealengine.com/u/mdonge)\
**Post date:** [September 5, 2016, 12:37pm UTC](https://forums.unrealengine.com/t/how-can-i-display-the-value-of-variable-on-the-screen/369237/5 "2016-09-05T12:37:13Z")

</div>

Set the owner with the spawn function, where you choose the blueprint to spawn. There is a owner node under !
