Download

Condition is False but Branch outputs True

Hi all, I’m having this issue inside the Event Graph of my Anim Blueprint.
I used a breakpoint in a moment when the Bool was False but the Branch outputs True and I can’t understand why this is happening.
Can someone please explain this thing?

Alt F4 / ctrl alt delete. Reboot.

Could be many reasons. At the top of the BP you have a drop down selector.
It could be that the selector isn’t properly set.

Regardless you shouldn’t really have any code within the animation blueprint …
Which would 100% solve this issue? :stuck_out_tongue_winking_eye:

Thanks for the reply, but I tried reboot and update without any result.
Anyway, why I shouldn’t have any code in the Anim Blueprint? I’m new to animation and I have different weapons with different idle pose animations. How should I do that in a better way?

Can you Print the Bool before the branch? What do you get?

The answer is that UE Variable Watch is totally sht isn’t reliable whatsoever. There are other similar use cases or gotchas to be aware of too see last paragraph here. So sometimes there’s just no avoiding assigning variables to class-level variables for more accurate debugging, or insert a print string. Epic need to improve basic debugging in the editor. :rage:

The fact is that the Bool here is set to False, the Anim BP knows it but still outputs True.
If i print it says True but it should be False. I really don’t know. Now I’m trying some kind of tricks to make it work.

Its CLEARLY not set to FALSE!!! Variable-Watch debugging in the editor is borked:wink:

1 Like

I mean I set it to False in the actor it comes from, so in that moment it should be False because i set it False. That is why I don’t understand why it thinks it’s True.

Because it is? :stuck_out_tongue: In this case its your logic that’s borked. Spend time tracking down bad assumptions. Either code exists to set it to True you’ve forgotten about, or its a startup-order race-condition, or something else like looking at the wrong debugging instance…

Have you spawned more than one Character using the same Anim-BP maybe? If so, the most obvious risk is you’re viewing the wrong one (wrong instance). So you just need to spend time stepping through the code to see what’s happening. This seems most likely user error though… Whereas the variable watch mismatch is an editor bug / glitch. :wink:

That almost deserves its own topic really.

In short:
Code in the animation blueprint is bad. All kinds of bad.

Your character should do all the math/changes and directly update variables in the animation blueprint directly.
(Note that there’s is obviously 0 need to have the animation reach to the character to get a variable and update its own variable when the character can just directly change the variable).

And, your animation graph should always try and use fast path. Which means no And Or or any other kind of test (Except for Not) can occur within state transitions.

Probably a Montage unless you really require a completely different stance.
It sort of depends on what is happening with the character and the quality of your animations.

Possibly you just need different Aim Offsets, which means you can do the change at the graph level instead of at the pose level.
Just depends on what it is you are after.