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 multiple transitions with the same from and to nodes in Animation State Machine #4352

Open
WindyDarian opened this issue Apr 5, 2022 · 3 comments

Comments

@WindyDarian
Copy link

Describe the project you are working on

A 3D ARPG game

Describe the problem or limitation you are having in your project

I have a use case that is kind of hard to work around with the restriction of only one transition for each direction between two nodes. The simplified version is my character has attack and idle animation states, and I want to go back from attack to idle when either the animation is fully played, or the attack is interrupted for whatever reason. If I have only one transition with "At End", it seems I cant easily force interrupt the state to go to the next state.

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

I think allowing multiple transitions with the same from and to nodes will fix the problem. It be nice if the transitions can have different conditions, priorities and blend duration.

For my case, one of the transition will be "At End" for when attack animation fully play and return to idle. And another transition will have a condition with a script variable script, for when the attack animation needs to be interrupted manually.

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

I have my local code as a pull request at godotengine/godot#59872
transitions

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

I feel this is a common enough case for action/animation heavy games. I find it hard to work around without another dummy "relay" node, and the dummy node needed to have animation hooked up as well.

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

I feel animation state machine is currently very limited and this can make it more flexible.

@WindyDarian
Copy link
Author

closing per comments in godotengine/godot#59872

@WindyDarian WindyDarian closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2022
@MarkoSFG
Copy link

MarkoSFG commented Mar 6, 2024

Hey @WindyDarian - I'm running into the same requirements (and having to hack around by duplicating states) :) would love if this made it into engine.

@WindyDarian
Copy link
Author

Hi! Please allow me to reopen the feature request. Per discussion on godotengine/godot#59872

I think there are 3 different needs:

  1. with nodes A and B, allow transition from A to B under more than one conditions. (Add AnimationTree Advance Expressions godot#61196 has this)
  2. with nodes A and B, when transitioning from A to B under different conditions, allow different fade times (this PR would have this)
  3. allow blending between more than two states during transition, or more than one fade happening at a time, for example, if going from A to B, before fade finishes go to C, should result in an animation blend of all A, B and C (Fix for short animation blend taking too long when played during a long animation blend. godot#37001 )

There is still need to be able to set different fade length under different transition conditions. Allowing multiple transitions from the same nodes will be one way to have this. Though the PR is dated, and new code needs to be written if we want this.

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

4 participants