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

Cannot repeat a one-shot animation in BlendSpace2D #53858

Closed
pedestriantactics opened this issue Oct 15, 2021 · 3 comments
Closed

Cannot repeat a one-shot animation in BlendSpace2D #53858

pedestriantactics opened this issue Oct 15, 2021 · 3 comments

Comments

@pedestriantactics
Copy link

pedestriantactics commented Oct 15, 2021

Godot version

3.3.4

System information

macOS Big Sur 11.6

Issue description

Short version: There seems to be no way to manually restart an animation that's part of a BlendSpace2D unless the position in the blend space changes to a different animation first.

In my top-down game my 2D characters might take a drink of whatever they're holding. To do this I command my animState to travel to a BlendSpace2D that contains one-shot animations for drinking for each facing direction.

Once drinking is finished, each animation contains a frame that manually fires the "animation_finished" signal (because they don't automatically fire this signal when in a BlendSpace 🤷‍♂️ another issue). My Drinking function (which is an async Task in C#) awaits this call and then tells the animState to travel back to the idle state.

This is all fine and dandy, unless the character drinks again.

Unless they change their facing direction before drinking again, traveling back to the Drink blend space doesn't cause the animation to start over. I have tried firing the Stop(true) action after the animation has finished. I have tried using the Seek(0) command. I have even tried Stop followed by animationPlayer.Play(animationPlayer.CurrentAnimation) which then states that there isn't one.

Surely someone must have run into this with a jump or attack animation on a character with different facing directions. How do you get the animation to start over while the character is facing the same direction??

Steps to reproduce

You can reproduce it this way:

  • Create an animTree
  • Inside, create two blendspace 2d nodes
  • Create respective animations for four quadrants of the blendspaces
  • Command a travel twice from one space to another while not changing the positions in the blend tree
  • The animation will not start over

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Oct 15, 2021

@pedestriantactics Please upload a minimal reproduction project to make this easier to troubleshoot.

@TokageItLab
Copy link
Member

May related by #34179

@TokageItLab
Copy link
Member

Closed by #71418. Also, BlendSpace2D now has a sync option, which I believe can be combined with NodeOneShot and others to solve this.

@TokageItLab TokageItLab added this to the 4.0 milestone Feb 17, 2023
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

3 participants