I'm trying to set a boolean variable to true in Unreal, but it just won't change. I've double-checked the parameters, and it's neither private nor constant. It shows the correct default values when I start the game. I even added a print statement for debugging, and it outputs "Hello," which confirms the code runs. But despite this, the variable doesn't seem to update. Am I missing something, or is there something odd going on with Unreal? I'm having the same issue with other data types as well. I initially thought it might be that the object type was incorrect, but that's not the case. I really don't get what's going wrong!
3 Answers
Have you checked if any part of your code is possibly overwriting that variable after you set it? It might not be a visibility issue; could just be a logic quirk that Unreal tends to have.
Glad you figured it out! I bet your attack was finishing too quickly for the variable to update as expected. Sometimes Unreal really makes you work for those solutions!
Haha, exactly! It just needed some time! Thanks for the support, everyone!
It sounds like there might be a mistake in your code somewhere. But without seeing it, it’s tough to say what specifically might be wrong. If the line where you set the variable is actually getting executed, check if there’s a conflict between global and local variables. Sometimes those sneaky logic errors can trip you up!
Exactly! If the scope of your variable is mixed up, it could be resetting without you knowing. Just watch out for overwrites!

So true! That’s happened to me before—I didn't realize something else was changing the value!