# Why is my integer being set to 0

**URL:** <https://forums.unrealengine.com/t/why-is-my-integer-being-set-to-0/467995>\
**Category:** UI\
**Tags:** set, unreal-engine, Widget, question, Blueprint\
**Created:** [July 11, 2020, 1:28am UTC](https://forums.unrealengine.com/t/why-is-my-integer-being-set-to-0/467995 "2020-07-11T01:28:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MagiaNegra89](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MagiaNegra89](https://forums.unrealengine.com/u/MagiaNegra89)\
**Post date:** [July 11, 2020, 1:28am UTC](https://forums.unrealengine.com/t/why-is-my-integer-being-set-to-0/467995/1 "2020-07-11T01:28:09Z")

</div>

Hi, I am currently following through this tutorial series [Unreal Engine 4 Tutorial - Gamepad UMG Control Pt. 2 - Page Menu - YouTube](https://www.youtube.com/watch?v=s6W7SoO9lkA&t=231s)

I am running into an issue at about 19:15 in the video. There is an integer variable that is being called from a BP controller, and being set inside of a widget blueprint. The value for the integer is coming from an array of widgets. My problem that I cannot figure out, even after redoing the tutorial twice, is that once I set the integer value and try to print string the value, it only returns a 0.

Here is a screenshot from the video of the part i am having trouble with.

If I keep the nodes that are highlighted in red, and then try to print string the “page index” value, it only returns a 0. It does not print the correct index values that were given to the widgets. However, if I remove the nodes in red and just print string the integer value of “find”, I get the correct values. Does anyone have any idea why trying to set this value is returning a 0?

 ![306819-integer.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/1/ec15be03d82ae29f36eea047c149c92d68776d84.png)

---

<div class="post-metadata">

**Author:** ![araz01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/araz01/32/1028814_2.png) [@araz01](https://forums.unrealengine.com/u/araz01)\
**Post date:** [October 9, 2021, 10:06pm UTC](https://forums.unrealengine.com/t/why-is-my-integer-being-set-to-0/467995/2 "2021-10-09T22:06:53Z")

</div>

Mine Too, Doesn’t Work Because I Set The Int To A Number When I Press Fire, Then It Goes Back To 0 Every Frame, WTF

Edit:  
Actually, IT Doesnt Change At All, BRU! Im Referncing An Int From Widget To Enemy Bp To Check Gun Being Used And All I Get It 0s On The Bp While On The Widget Its Changed To The Number Of The Gun, Can’t Use The Switch Int Thing, Terrible, Truly Terrible

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 10, 2021, 9:41am UTC](https://forums.unrealengine.com/t/why-is-my-integer-being-set-to-0/467995/3 "2021-10-10T09:41:04Z")

</div>

Variables do not change or reset on their own. You’re doing it - it’s just inexperience or you misinterpret the logic behind it.
