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

Problem with Animations on BlendTrees and Negative TimeScales #77535

Closed
ithiro opened this issue May 26, 2023 · 2 comments · Fixed by #79403
Closed

Problem with Animations on BlendTrees and Negative TimeScales #77535

ithiro opened this issue May 26, 2023 · 2 comments · Fixed by #79403

Comments

@ithiro
Copy link

ithiro commented May 26, 2023

Godot version

v4.0.3.stable.official [5222a99]

System information

Windows 10

Issue description

In an Animation BlendTree, if you connect a TimeScale node with a negative value (to play an animation, in this case, with Linear Loop, in reverse) after a Transition node with XFade Time, and request a switch between states, the resulting animation gets completely messed up.

Putting the timescale before the transition (and right after the Animation nodes) solves the problem, but creates an excessively large number of repeated nodes if you have several animations to transition between.

Other issues may steam from improper handling of animations being played in reverse, specially in complex Animation BlendTrees. Blend2 doesn't seem to take too kindly to them, with weird blending between looped animations with positive and negative timescales.

Steps to reproduce

  1. Create a BlendTree for an animated character (in my case Imported from Blender as a .glb file and created as an Inherited Scene).
  2. Setup your BlendTree like this:
    image
  3. Click in the Transition node (Make sure it has an XFade Time of like 0.25s) to switch between states.
  4. Watch as your character takes off.

Minimal reproduction project

TestRoom.zip

@Calinou
Copy link
Member

Calinou commented May 26, 2023

cc @TokageItLab

@TokageItLab
Copy link
Member

TokageItLab commented May 27, 2023

If the auto transitions don't work, that is expected behavior1, but if the manual Xfade is broken, that may not be a good thing. Perhaps the fade time accumlator in Xfade does not support negative values. I assume this can be solved by using absolute values.

Footnotes

  1. Negative timescale does not treat the beginning of the NodeAnimation as the end of the animation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants