Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using AnimationTree removes basic functionality of AnimationPlayer (i.e. animation_finished signal) #70078

Closed
wmsteinhardt opened this issue Dec 14, 2022 · 2 comments

Comments

@wmsteinhardt
Copy link

Godot version

4.0 Beta 8

System information

Windows 10/11

Issue description

Probably the most commonly used signal from the AnimationPlayer (at least in my experience) is "animation_finished(anim_name: StringName)". Unfortunately, using an AnimationTree blocks the use of this signal (and I am guessing the others). This is unexpected and unintuitive - the AnimationTree is a powerful tool, and it is surprising to see that using it actually removes basic functionality of the AnimationPlayer.

There are certainly workarounds. One can add a function call to the animation track to serve the same purpose. However, if you are regularly re-importing assets and animations, configuring this every time is cumbersome, especially for many animation tracks. Another option is to use a OneShot node in a BlendTree inside your AnimationTree, so you can check if its active - but this is also cumbersome and needlessly complex, as you have to add a dummy animation for the OneShot to work with in every such case. There are probably other approaches, and I'd welcome suggestions.

This is all hinted at in the documentation, but its description doesn't really explain the extent of the limitations: "Note: When linked with an AnimationPlayer, several properties and methods of the corresponding AnimationPlayer will not function as expected. Playback and transitions should be handled using only the AnimationTree and its constituent AnimationNode(s). The AnimationPlayer node should be used solely for adding, deleting, and editing animations." That's partly why I submitted this as a bug report.

IMO it would be more intuitive to retain the basic functionality of the AnimationPlayer in some capacity in the AnimationTree, even if that means adding nodes or functionality to existing nodes (like Seek) such that these signals can be used.

Steps to reproduce

  1. Add animations to an AnimationPlayer
  2. Add an AnimationTree and set its anim_player to the AnimationPlayer
  3. Try to use signals from the AnimationPlayer.

Minimal reproduction project

AnimationTreeStateMachineRoot.zip

@timothyqiu
Copy link
Member

This is all hinted at in the documentation, but its description doesn't really explain the extent of the limitations

AFAIK, AnimationTree uses the AnimationPlayer as the container of animations. An AnimationTree plays / blends the animations on its own, i.e. the AnimationPlayer does not play anything, thus no signals are emitted.

@TokageItLab
Copy link
Member

Duplicate of #28311

@TokageItLab TokageItLab marked this as a duplicate of #28311 Dec 15, 2022
@TokageItLab TokageItLab closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants