Hello, all.
I’m learning how to use an AnimationTree.
I’ve created some animations and works fine.
I can move my character, walk, jump and play idle animations.
I’m activating o deativating each animations dependenging on a var estado_actual.
Now I have only 3 animations, but I want to add a lot more, so its a bit ugly to do it this way.
How do I pass a state to my tree without having to deactivate the previous states?
it’s working, I know.
But if i have like 10 animations I need to add 10 lines in each case of the match… I thought there was be a way to just put the current condition, just in one line.
I’m using AnimationTree with root = AnimationNodeStateMachine, may be with other type ?
EDIT:
I’m trying othe thing.
I’ve deleted the conditions and added expressions like this:
estado == Globals.estados.idle
I’ve created a script in the animationTree with the following code:
extends AnimationTree
var estado
func set_estado( i_estado):
estado = i_estado
Now, I’m calling the method set_state from the player script:
animation_tree.set_estado(estado_actual)
but is not working… something is missing, i’ll check