How to make animation start playing only after transition is complete?

Godot Version

4.2.1 - 4.2.2

Question

I’m trying to put an attack animation in my animation tree. (in 3d, with a skeletal animation)
However, putting any amount of time for the transition between a stationary animation, and another animation will play both at the same time, eating up part of the animation it is transitioning to.
Eg.: an attack animation that’s 1 second, if given 0.5 second transition will only play half of it fully, leaving only the last half of a sword swing to happen, if xfade value is set to anything that looks visible.
How do I make the animation transiition instead transition to the first frame of the next animation, so it plays in full ?

It’s not possible to set xfade time to negative, to instead only eat into the previous animation, nor is it possible to manipulate the xfade curve to do similar, and cannot see any toggle for this

I don’t know the details for your animation or what your desired result is.
Have you tried to use a OneShot animation; or are you not using that for a reason?

this is a universal issue
When transitioning from one animation state to another, whether it’s a blendtree or a state machine, if the xfade time or fadein time are set to anything at all, they will eat into the animation that’s being transitioned to.
Which causes an issue if you want the entire animation to play, which is a lot of cases.

Oneshot makes no difference, it works exactly the same (tested it both with AnimationNodeStatemachine and Blendtree, they both do this and can’t find any way to change this behaviour)

Just a question, by why do you need to fade the animation(s) if all you want is to immediately play the attack animation? Are you trying to delay the attack animation?

In any case, the behaviour you’re seeing for transitions between animation nodes is the expected behaviour. The general use case is to perform a seamless transition between animations. If you want to adjust the timing of an animation (e.g. wait until another animation is finished), you need to make a script that interacts with the blend tree.

EDIT: I guess you could also make your own AnimationNode that allows the type of blending you’re looking for.

The issue is, it doesn’t blend into the attack animation at the first frame, rather, it starts playing the animation as it starts transitioning, leading to a part of the animation not playing fully, which makes something like a quick attack animation basically impossible to use because, by the time it’s transitioned, only about half of the animation will play.eg: If an attack animation is 0.5 seconds, and i set the transtion time to 0.2 seconds, it will only fully play 0.3 seconds of the attack animation.

What is need is for the transition to blend into the first frame of the animation that’s being transitioned to

Eg: In unity, if you set transition time to -1, it will start transitioning for a second, end up blending into the first frame of the animation that’s being transitioned to, and then play it in full.

Hence, looking for replicating this kind of behaviour.

Seamless enough transition from one animation, to another, with the latter one playing in full, and not begining to play until the transition is finished, as it creates use cases where the animations become unusable if using any transition time at all.

As I said:

Since you see this as a “universal issue”, I recommend going with the latter approach and make your own AnimationNode.

1 Like

A workaround for this would be to extend your attack animation, play the first frame for 0.2 seconds at the beginning. Or make it a separate transition animation that plays before the attack.

1 Like

Will try making an animation node then, at least there’s some level of workaround
Though this feels like obvious functionality that should be in there.

ig might suggest it

1 Like