You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AnimationMixer immediately emits animation_finished upon traveling to AnimationNodeBlendSpace1D when blend_point changes while the blendspace node is not playing.
#92180
Open
adambiser opened this issue
May 21, 2024
· 0 comments
In some situations, a AnimationNodeBlendSpace1D node can fire animation_finished immediately after traveling to it without first playing the animation.
Steps to reproduce
Given an AnimationTree with two nodes: "idle", an AnimationNodeAnimation, and "attack", an AnimationNodeBlendSpace1D with 3 points, one at 0.0 for animation "attack_1" and one positive point and one negative point each for animation "attack_2". There is also an animation_finished handler that calls travel("idle") when it fires.
Set the "attack" blend point to a value that would call one of the animations, ie 1.0 for "attack_2"
travel("attack")
await animation_tree.animation_finished. The animation_finished handler calls travel("idle")
Optionally wait an arbitrary amount of time
Set the "attack" blend point value to a different "zone" so another blend point is used that would call the other attack animation, ie 0.0 for "attack_1"
Optionally wait an arbitrary amount of time
travel("attack")
Note that animation_finished fires for "attack_1" the next frame.
A way I've found to get around the problem is to add blend points in code, not the editor. Even removing each editor-created blend points and immediately re-adding them will make this work as expected.
Side comment
It would be great to have a signal like "animation_node_finished" that would emit at the same time that the "At End" transition would normally occur. Otherwise, it appears we have to test for any one of the animations within the blendspace to have finished.
The text was updated successfully, but these errors were encountered:
adambiser
changed the title
AnimationMixer immediately emits animation_finished on AnimationNodeBlendSpace1D after blend_point changes while the blendspace node is not playing.
AnimationMixer immediately emits animation_finished upon traveling to AnimationNodeBlendSpace1D when blend_point changes while the blendspace node is not playing.
May 21, 2024
Tested versions
System information
Godot v4.2.2.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GT 730 (NVIDIA; 30.0.14.7414) - Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 Threads)
Issue description
In some situations, a AnimationNodeBlendSpace1D node can fire animation_finished immediately after traveling to it without first playing the animation.
Steps to reproduce
Given an AnimationTree with two nodes: "idle", an AnimationNodeAnimation, and "attack", an AnimationNodeBlendSpace1D with 3 points, one at 0.0 for animation "attack_1" and one positive point and one negative point each for animation "attack_2". There is also an animation_finished handler that calls travel("idle") when it fires.
A way I've found to get around the problem is to add blend points in code, not the editor. Even removing each editor-created blend points and immediately re-adding them will make this work as expected.
Side comment
It would be great to have a signal like "animation_node_finished" that would emit at the same time that the "At End" transition would normally occur. Otherwise, it appears we have to test for any one of the animations within the blendspace to have finished.
Minimal reproduction project (MRP)
AnimationTreeTest2.zip
The text was updated successfully, but these errors were encountered: