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

Allow StateMachine and NodeTransition / OneShot to restart when a transition to the same state is attempted #5965

Closed
TokageItLab opened this issue Dec 20, 2022 · 0 comments · Fixed by godotengine/godot#71418
Assignees
Milestone

Comments

@TokageItLab
Copy link
Member

TokageItLab commented Dec 20, 2022

Describe the project you are working on

3D character game

Describe the problem or limitation you are having in your project

It is difficult to restart animation in AnimationTree

Describe the feature / enhancement and how it helps to overcome the problem or limitation

If you want to switch multiple animations, you can use the StateMachine or NodeTransition / OneShot functions, but if you want to restart the same animation, you must implement a restart workaround with special case.

There is no particular reason not to restart the transition to the same state. If you do not restart, the animation will play normally if the transition to the same state is spammed. However, the more correct way is to implement non-spamming on the script side.

This restart-able state will allow you to implement switching multiple animations with the same effort as the AnimationPlayer::play().

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Improve StateMachine and NodeTransition / OneShot to restart on transitions to the same state.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

StateMachine and AnimationTree are core

@TokageItLab TokageItLab added this to the 4.x milestone Dec 20, 2022
@TokageItLab TokageItLab changed the title Allow StateMachine and NodeTransition to restart when a transition to the same state is attempted Allow StateMachine and NodeTransition / OneShot to restart when a transition to the same state is attempted Jan 11, 2023
@TokageItLab TokageItLab self-assigned this Jan 11, 2023
@Calinou Calinou moved this from In Discussion to Implemented in Godot Proposal Metaverse Jan 19, 2023
@akien-mga akien-mga modified the milestones: 4.x, 4.0 Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Implemented
2 participants