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

AnimationTree: OneShot should reset StateMachine internal state upon its completion #69063

Closed
Tracked by #73534
xahon opened this issue Nov 23, 2022 · 0 comments · Fixed by #75759
Closed
Tracked by #73534

AnimationTree: OneShot should reset StateMachine internal state upon its completion #69063

xahon opened this issue Nov 23, 2022 · 0 comments · Fixed by #75759

Comments

@xahon
Copy link

xahon commented Nov 23, 2022

Godot version

4.0 dev

System information

Windows 10

Issue description

I have an AnimationTree root blendtree that looks like that:
image

Here I have a default locomotion animations and an override blending for attack animation to make it possible to both walk and attack at the same time. The problem is that after the very first OneShot's shot my state machine gets its job done and OneShot's shot flag becomes false again but I can't make it true another time because internal state machine's state is set to "exited" (it's my assumption). The only way I could fix this is to recreate AnimationNodeStateMachinePlayback object on the SM node. I'm not sure if it's possible to do from code. It clearly looks like a bug for me. AnimationTree should either have a flag "Reset state machine on exit" or it should do it by default. IMO state machines in animation should behave differently from a regular state machines used for other software. I use a state machine here to make a complex animation logic (Do the first animation, after completion of the first I want to play another looped animation, then I wait for an event or input from user, etc…) and expected it to reset its state each time I call it from a particular node but I don't expect it to be reset while they are doing their job (For example if I trigger OneShot while state machine didn't yet reached the exit node), however, the latter can be handled by the logic in a script

Steps to reproduce

In the attached project:

  1. Click on the AnimationTree with name "CLICK ME"
  2. Open AnimationTree panel below
  3. Click on OneShot's "On"
  4. Wait for a second while a dummy animation played (1s)
  5. Try activate OneShot again - Immediate reset happens :(

Minimal reproduction project

image
Issue.zip

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.

2 participants