in my c++ class i have several bools. This bool in particular, lets call it bool One, is set as false in beginPlay. I am using blueprints to call functions from this c++ class. After a function is being called that sets, bool Two, to true. It is also setting bool One to true, but bool One is not inside of the function. I have also found all references of bool One, and there is nothing changing it to true. In the event tick, i have an if statement stating to do some stuff if bool Two is true, and again, inside that if statement, bool One does not exist… so why is bool One being changed to true?
It is also setting bool One to true, but bool One is not inside of the function.
What do you mean?
ok so scenario is like this:
bool One= false;
bool Two = false;
event tick
{
if(!One)
{
do something (does not run after functionTwo is called)
}
if(Two)
{
do something (does not include any operations using One)
}
}
functionTwo
{
Two = true;
}
so One = false;
after functionTwo gets called via blueprints,
One = true;
If you can’t find the place where your variable’s value changes, you could try to use “Watch” option in compiler to check this variable’s value and read the code line-by-line. It just can not change the value by itself
i am still a noob, not sure how use the “Watch” option, or how to debug the ue4 project using visual studios, always get errors when I try. That is why i am so confused, how is it changing if there is nothing changing it. I have checked the variables references throughout the solution and it only comes up to One = false, and if(!One).
Looks strange. Take a look on how to watch variables: 7 Ways to Look at the Values of Variables While Debugging in Visual Studio - Azure DevOps Blog After that you will be able to see where your variable changes
im not getting the error anymore… all i did was in the if(Two), i commented out Two = false; and i uncommented it, so the line gets read again… and the program worked… One was not being set to true anymore… but why was it in the first place 0.0 sooo confusing.