Variable value does not change

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.


  • 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

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?

  1. Yes, it does
  2. Yes
  3. I call him when the quest is complete.

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

So which variable does not change:

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. :person_shrugging:

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

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

Little can be deducted from what’s shown. Set up breakpoints, step through the script.

I’ve already tried it

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

video size greater than 25mb

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.



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.

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

Not rue, you do change it here:

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


Put it on Tick:

image

What do you actually get as you click?

image

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

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… :expressionless:

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

So I have no idea why this is happening.