-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
AnimationPlayer signals are not emitting when animations played from AnimationTree #28311
Comments
I had the same problem. I solved it by adding a callback in the animation. In your animation add the track for functions callback. Then you set the track key, and specify the name of the callback. |
Yeah, I did it too, but the problem here is if function key too close to 0 or end of animation - it is sometimes not triggering so you have to move it +/- dozen milliseconds on animation timeline which makes timing animation even more cumbersome, even though I used the most simple animations, without any blending or time scaling/seeking. |
I can confirm this bug is present on Linux as well (Manjaro). Unfortunately, the above workaround is not possible for me, since the function I need to call is in a script attached to an AnimationNode inside the AnimationTree. When creating a call method track, you can only select nodes which are displayed in the scene dock, and AnimationNodes inside an AnimationTree are not displayed. |
Learning Godot's built in StateMachine!!! It's been okay, but I wish it had signals. Also, the backing AnimationPlayer doesn't emit signals which sucks. godotengine/godot#28311
@mateusbds #30508 might be of interest to you. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Also having this issue, but this workaround worked like a charm for my use case (adding call method tracks to the animation(s) in question): https://amp.reddit.com/r/godot/comments/7lsrga/animationtreeplayer_detecting_when_an_animation/ |
Is it intended action? |
Just hit this as well. The explicit "Call Method Track" to a node won't work for my specific use case as the target is dynamically created by a GdNative library. |
Same issue. Resolved it by using timers and setting wait_time to animation length, but it's a very makeshift solution. |
Damn, I am running into all sorts of issues with this limitation. You can't even get the current animation or position being played from the animation tree. None of the methods or signals from the animation player work when using a tree. The timer workaround is not suitable if you have animations that blend in and out at different ramped speeds. The function track is not really suitable if you are importing gltf animations, but makes sense if your animations are created in Godot itself. Hopefully there is a dev working on patch for this, as it is very difficult to work around! |
Is there currently any other way to dynamically blend animations at runtime? |
Commenting to link this relevant issue and pull request: godotengine/godot-proposals#1462 (comment) Possibly a better solution overall, since it means we don't have implement our own state machine to effectively use the built in state machine .... |
Confirming that I have the same issue when using AnimationPlayer from AnimationTree in 3.4.4.stable |
AnimationTree only reads AnimationPlayer animations, it does not play the AnimationPlayer. By the way, I remember @reduz and I were talking about AnimationTree loading animations from the AnimationLibrary directly. There is also a fundamental problem with emitting signals from AnimationBlendTree's NodeAnimation and getting their playback position. This is because the AnimationTree is a node, but the AnimationBlendTree is a resource and can be referenced by multiple nodes. So, if that is what you need, we will need to implement the signal correctly on the AnimationTree side. |
I always thought that await animation_player.animation_finished didn't work, when I used AnimationTree.
If the AnimationTree only uses animations from the AnimationPlayer and nothing else. It really makes sense to put them in a separate resource. To avoid similar confusion in the future. And remove the extra node from the scene tree. |
Bugsquad edit: This issue has been confirmed several times already. No need to confirm it further.
Godot version:
3.1 stable
OS/device including version:
Windows 10 Pro 1809
Issue description:
AnimationPlayer animations signals are not firing when animation played from within any AnimationTree node. I assume this is a bug, since AnimationPlayer directly attached to AnimationTree and AnimationTree doesn't have it's own signals controlling animation flow, so if tree is complex enough it becomes impossible to control it without signals.
I'm very confised since it is very important part of functionality but I couldn't find anyone bothered by its absence so I thought maybe I'm misunderstanding something, but couldn't find any solution so far.
#8521
Steps to reproduce:
Create (looping or not) animation in AnimationPlayer.
Create AnimationTree, assign AnimationPlayer to it. Inside AnimationTree (AnimationNodeBlendTree for ex) create Animation Node and connect it to output or any other combination. Activate AnimationTree, run.
Minimal reproduction project:
Test.zip
Enabling "autostart" on timer will allow signals emitting, since animations played directly from AnimationPlayer, indicating that it is perfectly fine by itself.
The text was updated successfully, but these errors were encountered: