Is it possible to set an AnimationTree's transition node current value in code without using the value's index?

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

I’m trying to use an AnimationTree to manage attack animations with different weapons using Transition nodes.

Instead of
$AnimationTree['parameters/weapon/current'] = 1

I would like to do
$AnimationTree['parameters/weapon/current'] = 'sword'

Is this possible? Or is there a better way of going about doing this?

Maybe try using enumerations to refer to the desired animations?

enum Weapons ( KNIFE, SWORD, BOW }
$AnimationTree['parameters/weapon/current'] = Weapons.SWORD

Ertain | 2021-01-13 09:23