How can I access an AnimationNodeAnimation inside an AnimationNodeBlendTree

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

So, I want to access the AnimationNodeAnimation holding_weapong and be able to switch the animation it’s using via code depending the type of weapon the player character it’s using (e.g. pistol, shotgun, etc). If it’s not possible, any other recommendations or tips to figure this out is appreciated. Thanks!

My current AnimationNodeBlendTree:

:bust_in_silhouette: Reply From: wokeraccoon

Solved it! For any poor souls from years into the future:

var AnimTree = $AnimationTree

func _ready():
    AnimTree.tree_root.get_node("Name_of_AnimationNodeAnimation").animation = "Name_of_the_animation_you_want_to_set"