# Variable value does not change

**URL:** <https://forums.unrealengine.com/t/variable-value-does-not-change/1357743>\
**Category:** Blueprint\
**Tags:** Variable, event-dispatcher, unreal-engine, functions, question\
**Created:** [November 2, 2023, 2:58pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743 "2023-11-02T14:58:45Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 2:58pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/1 "2023-11-02T14:58:46Z")

</div>

Hi everyone, I have a question. I have an event dispatcher: QuestComplete. When it is called in the function bound to it, the value of the variable that determines the choice of actions is changed. The problem is that this variable does not change its value after calling the event dispatcher and function. What to do? Please help me.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/6/ef67fb1c9c0b2a1088565eb4f5d93708cf3305e2.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/2/8727d684df2910e4910cb0e16ba1271c7f20a1b1.png)

---

<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:** [November 2, 2023, 3:02pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/2 "2023-11-02T15:02:46Z")

</div>

- does `QuestCompl` print?; if no:
- does the bind trigger?
- where / how / when do you call the dispatcher?

* * *

May be irrelevant but seems confusing _at a glance_:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/9/309751eaf3c0491b3cd656052c99e63b802b7bd7.png)

Shouldn’t the `True` / `False` be the other way round? I am assuming we’re trying to have 1 quest active and bound at a time. No?

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 3:10pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/3 "2023-11-02T15:10:34Z")

</div>

1. Yes, it does
2. Yes
3. I call him when the quest is complete.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/c/fcc56d2ed82789a875db78826d498b1f7810b41d.png)

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 3:11pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/4 "2023-11-02T15:11:11Z")

</div>

Yeah, I know, I just tried everything I could.

---

<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:** [November 2, 2023, 3:12pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/5 "2023-11-02T15:12:32Z")

</div>

So which variable does not change:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/2/8727d684df2910e4910cb0e16ba1271c7f20a1b1.png)

`Can Bind`? How do you know it does not change? How and what are you testing? Half the time the issue is in the testing method / expectations / logic rather than variables not changing values. It’s actually all the time, tbh. Even the debuggers are buggy and may reports values incorrectly. 🤷

Since this prints, the `CanBind` will change its value to `True`.

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 3:19pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/6 "2023-11-02T15:19:14Z")

</div>

That’s the funny thing. That through print (when I call it by pressing the button) shows false.  
With debug mode, everything is fine, in the sense that print is called and the variable is changed, but then when I press the button it still shows false

---

<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:** [November 2, 2023, 3:28pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/7 "2023-11-02T15:28:07Z")

</div>

Little can be deducted from what’s shown. Set up [breakpoints](https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/Blueprints/UserGuide/Debugging/), step through the script.

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 3:36pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/8 "2023-11-02T15:36:42Z")

</div>

I’ve already tried it

---

<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:** [November 2, 2023, 3:40pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/9 "2023-11-02T15:40:15Z")

</div>

So you know precisely when the values change, right!? Could you demonstrate when the change to `True` and then back to `False` happens?

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 3:43pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/10 "2023-11-02T15:43:41Z")

</div>

video size greater than 25mb

---

<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:** [November 2, 2023, 3:44pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/11 "2023-11-02T15:44:07Z")

</div>

Screenshots will do. Of the breakpoints triggering. I mean, you can see the breakpoints yourself, heh. You should know at this point when the change happens…

* * *

> video size greater than 25mb

It’s 2023, we’ll manage.

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 3:48pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/12 "2023-11-02T15:48:41Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/5/ee5e79bca4eb8c0c584e4012e57f36675aea955c.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/b/f0be8cddc51a693cd8a65531d074c19141b4d3ba.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/2/9c292f6d8d89287171a6a0fac48f491b9a4978dd.jpeg)

---

<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:** [November 2, 2023, 3:49pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/13 "2023-11-02T15:49:17Z")

</div>

But these are not the bool changes at all? You need to step through the script and draw conclusion. Figure out when the value of the bool reverses.

* * *

Or _find all_ places where the var is accessed and step through the list.

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 3:57pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/14 "2023-11-02T15:57:38Z")

</div>

I don’t change it everywhere except for the function being called.

---

<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:** [November 2, 2023, 3:58pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/15 "2023-11-02T15:58:56Z")

</div>

Not rue, you do change it here:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/a/9/8a9d9dabe758664b300fb9af43fb903097a8ac87.png)

Perhaps you change it elsewhere. Perhaps you have more than one instance of the widget? We can only guess.

* * *

Put it on Tick:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/1/a/91a93abfbe66c6b75dae53471a10cb3638542752.png)

What do you actually get as you click?

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 3:59pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/16 "2023-11-02T15:59:29Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/b/c/ebc56515ec0218dfdf3e2cd1028aabebce703797.png)

---

<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:** [November 2, 2023, 4:06pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/17 "2023-11-02T16:06:22Z")

</div>

> [@Everynone](#):
>
> You need to step through the script

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/5/c/85cec338d7040e53b219d1ea988919d3ef207361.png)

Check the breakpoints. We can’t even see these in the screenshots you posted.

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 4:11pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/18 "2023-11-02T16:11:42Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/8/be872468b882c6b904d5e3cb67ab07caa48da975.png)

---

<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:** [November 2, 2023, 4:19pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/19 "2023-11-02T16:19:47Z")

</div>

That’s great. But we already know this works… Find all the places where the variable gets accessed, breakpoint those. Keep stepping until you find the place that reverses the value.

* * *

If that’s all that you’re expecting as I am, frankly, a bit lost regarding what you need from us. You show us a variable that does change, but claim it does not. And we do not even know how you’re testing it… 😑

For all we know you may create a widget =\> remove it =\> create a new one and read default data.

---

<div class="post-metadata">

**Author:** ![blAddddDe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@blAddddDe](https://forums.unrealengine.com/u/blAddddDe)\
**Post date:** [November 2, 2023, 4:37pm UTC](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743/20 "2023-11-02T16:37:53Z")

</div>

So I have no idea why this is happening.

[Next page](https://forums.unrealengine.com/t/variable-value-does-not-change/1357743.md?page=2)
