-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
AnimationGraph
: Transition with the same NodeIndex
doesn't work
#12604
Comments
I'm looking into this right now. I'll post here when I have further updates on the matter. |
Okay, here's my understanding of why this happens on a basic level. When
This is a pretty thorny issue to solve in a satisfactory way, because it is indirectly a consequence of the fact that the However, in the meantime, we could consider implementing some kind of half-measure that prevents the worst of this from happening; for example, we could make it so that the animation just fully restarts (without blending) when I'll spend some time meditating on what a complete solution to this might actually look like as well, since it seems potentially important. |
Thanks for digging into this! Now it makes sense to me why it was "paused" and it correlates with my logs.
This behaviour is handled by the function
If we can avoid the regression before 0.14 it would be great, but I can also understand that we need to move forward with the architecture. I will also try to find some time to explore a potential solution now that I have a better understanding of the issue. |
@mweatherley So as far as I'm aware the plan was originally to remove The right solution here is going to be some sort of Unity-like In general, serious users of animation will need to make their own bespoke animation controllers that manipulate graphs and not use |
@pcwalton That makes a lot of sense; thanks for the context! |
Thank you for the extra explanations and the vision about the crate. As mentioned on Discord, I can wait for a new version of the crate until it meets my needs. There are external solutions that I can use for the current 0.13 version. I have "advanced" needs for animations so might be better for me to wait until the crate offers the functionalities I need. If at some point my knowledge and experience are sufficient to provide help I will. Or if someone has enough time for mentoring on some implementations and not the bandwidth to do it I could give it a try. So we can close this issue. |
Feel free to leave this open. I think the time is definitely right for out-of-tree experiments with animation controllers. We have egui-based node graph libraries so you could even make artist-friendly editors for them. When one of them gets mature enough I'd be in favor of merging it into the Bevy tree. |
Bevy version
ed44eb3913b1180604d468f1ae88fcd2dd3f68a5
AnimationGraph
, allowing for multiple animations to be blended together. #11989What you did
During the version 0.13 I implemented animations for a 3D character where I can play the same animation multiple times smoothly. I tried to do the same with the new animation graph implementation and observed some issues. I use
AnimationTransitions
toplay
a newNodeIndex
. It works between two different indexes and can play them smoothly back and forth. However I can't play the same animation (NodeIndex
) two times in a row, it's like one animation is skipped when there is a transition.What went wrong
Transition to the same
NodeIndex
isn't played. I can observe some regressions with the new implementation. I think we didn't consider cases where we want to halt the current animation to play exactly the same one but by interpolating it. It's the case when you want to play an attack animation - then you can check theseek_time
to avoid a spam attack. That's what I did with version 0.13 and it worked well.Additional information
How to reproduce
Use the
animated_fox
example, I commented some parts and forced to only play the same animation by pressing enter. You will see that the fox animations stops, then if you hit again it will replay it from the beginning (pretty much like replay/rewind) without interpolating.Check here
Gif of the issue + debug logs
You can see the logs on the left coming from my modified version of the
bevy_animation
crate to debug the events. We can see that playing the "slashing" animation two times push the old one to the transitions vector and then the weight is decreased. However the main animation doesn't seem to be playedOther behavior observed
If I launch two different animations by giving them some time, it runs smoothly (first part of the gif), but as soon as I spam the inputs to run them quickly (withdrawing / sheathing), it seems like it breaks the transition before it finishes and the character is stuck in a unfinished position (last part of the gif). I still use the
play
function fromAnimationTransitions
, I do not directly manipulate theAnimationPlayer
. It seems similar to me and might be correlated to the same issue.Contributing
If you need help for this issue I would be happy to contribute if someone can provide me some guidance on where to look. So far my investigations have led me to the transition issue. I suppose the node being the same, there is an update issue for playing the decreasing animation. But I didn't make more progress and thought it would be better to ask for help.
The text was updated successfully, but these errors were encountered: