Download

Is "NOT" broken in AnimGraphs transition rules?

So basically I was following a tutorial when suddenly found that the “NOT” node doesn’t work inside transitions rules.

In the video I show the Event Graph where I pick the boolean “is alive” from the character and promote to 2 booleans, “Is Alive” and “Is dead” with a not, everything ok for now.

Then go to the Anim Graph, where I have a death animation with a simple transition rule. If I use the boolean “Is dead”, works fine, character plays death animation when dies. But is I use “Is Alive” with a “NOT”, doesn’t work as spected and performs the death animation since beginning.

No chance.

It’s much more likely that your is dead is overwriting you is alive.
Watching vid now.

Check your default values. Your is alive is probably set to false.

1 Like

Checked both values with print string.

  • Is Alive value is True until character’s life gets to 0, then turns to False.
  • Is Dead value is False until character’s life gets to 0, then turns to True.

I tried even changing the Booleans names, just in case, but it is the same. Is basically like the NOT is being ignored inside the Transition Rule in the Anim Graph.

If that were the case, you would see about a billion posts complaining about it.
I can also confirm it’s not true based on the fact my animation blueprints work correctly.

You are probably forgetting something like setting the variable.

The dead giveaway is the fact that the dummy goes to the dead state immediately after you plug in the value.
Obviously the state of the character shouldn’t change if your default variable is set correctly.

Outside of the animation the same is also true. But the default value is probably what’s being used initially.

1 Like

Thanks, after some tests I found the problem!! I was assigning the values of each bool only on ticks, but wasn’t doing on begin play or set “Is Alive” true by default. So they were printing to screen the right values, because was using the same tick, but the values were wrong before the first tick and playing the death animation because that. Now I feel so silly!!

Thanks a lot for pointing me in the right direction.

1 Like

Don’t set vars on tick. Set them on events.