Animator Advance Conditions but if the value is FALSE

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Kanor

Greetings! I’ve got a rather advanced question about animator advance conditions.

I’ve got two animations in my state tree:

 _______  -->  _______
|  IDLE |     |  WALK |
|_______| <-- |_______|

This seamless transition is done using ADVANCE CONDITIONS! (woo!)

All animations (such as jumping) are connected to IDLE, With the help of the travel() method, we get a direct change FROM walk THROUGH idle TO the desired animation. It works great. When the jump ends, the handy advance condition “walking” informs it to immediately go back to the walking animation.

	# Just leave this thing on as long as the player is moving left or right.
	# It'll auto-play walking when idle, and do nothing on other animations.
	animator["parameters/conditions/walking"] = true

Wonderful!

So how can I make the not_walking condition? When a player stops walking, the condition should invert to inform the animation to change to idle. But that part’s not so pretty. Right now I’ve just got:

# Hooray! Except maybe this is overkill? An extra variable just for NOT WALK?
animator["parameters/conditions/walking"] = true
animator["parameters/conditions/not_walking"] = false
..
animator["parameters/conditions/walking"] = false
animator["parameters/conditions/not_walking"] = true

Every time! It’s fine, but it’s not great. I want the advance condition in the transition to be like “!walking” so for both TO and FROM walking can depend on the single “walking” condition.

Is that a thing? I WANT IT TO BE A THING!

:bust_in_silhouette: Reply From: davidoc

This has been pointed out, I created an issue in the proposoals site:

Proposal

And Riteo made a pull request to merge the change into the repository:

Pull request

Right now we need to wait until the change is merged, in the meanwhile you have two options:

A) Continue to work with the not_ variables
B) Compile Godot yourself and add the changes from Riteo

Right now I’m just using the option A.

That’s awesome news! Thank you so much!

Kanor | 2020-08-10 22:31