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

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

Comments

@adambiser
Copy link

Tested versions

  • Reproducible in v4.2.2.stable.official [15073af]

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.

  1. Set the "attack" blend point to a value that would call one of the animations, ie 1.0 for "attack_2"
  2. travel("attack")
  3. await animation_tree.animation_finished. The animation_finished handler calls travel("idle")
  4. Optionally wait an arbitrary amount of time
  5. 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"
  6. Optionally wait an arbitrary amount of time
  7. travel("attack")
  8. 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.

Minimal reproduction project (MRP)

AnimationTreeTest2.zip

@adambiser 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
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

2 participants