Hi. I'm trying to make a character blink, and so I've created an AnimationPlayer that has all the same animations as the original one except that the character has its eyes closed. I thought this would be a simple solution because all I would have to do is switch the AnimationTree's anim_player property when the character is blinking.
Unfortunately doing $AnimationTree.anim_player = NodePath("BlinkPlayer")
doesn't seem to work... I've tried $AnimationTree.set_animation_player()
as well, which doesn't yield any different results.
The resulting warning:
E 0:00:02.239 _process_graph: AnimationTree: no valid AnimationPlayer path set, disabling playback
<C++ Source> scene/animation/animation_tree.cpp:762 @ _process_graph()
Is it impossible to change the animation player while the game is running? Should I find a different method to get the player blinking? Thanks!