0 votes

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!

Godot version 3.3.2.stable.mono.official
in Engine by (16 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.