How can I make the AnimationTree start the next animation from the frame the last one was?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DaviBraid

I have two animations of 13 frames
One is canned Basic - Run and the other is called Basic- RunAtk

When I press a button to attack, I want the animation tree to go from Basic - Run to Basic - RunAtk but I want the transition to be seemless.

For instance, if the previous animation was in frame 7, I’d like the nest one to start at frame 8. Is there anything I can do to make it happen?

if move_dir != 0 and grounded:
	animation_state.travel("Basic - Run")
if move_dir == 0 and grounded:
	animation_state.travel("Basic - Idle")
if timedash < 0 and grounded and move_dir != 0:
	animation_state.travel("Basic - Dash")
if not grounded and y_velocity < 0:
	animation_state.travel("Basic Jump - Transition")
if not grounded and y_velocity >= 0:
	animation_state.travel("Basic Jump - Fall Loop")
if wall_slide:
	animation_state.travel("Basic - Wall Slide Loop")
if wall_slide and y_velocity < 0:
	animation_state.travel("Basic - Wall Jump")
if (left_ray.is_colliding() or right_ray.is_colliding()) and Input.is_action_just_pressed("Jump"):
	animation_state.travel("Basic - Wall Jump")
:bust_in_silhouette: Reply From: Coxcopi

You can use the transition type called “Sync”, which continues the next state where the last one was stopped.

This is also explained here:

You can use the transition type called “Sync”, which continues the
next state where the last one was stopped.

That doesn’t really work, though. It just waits until the animation is finished to play the next frame.

What I want is, for instance, if the first animation was at frame 5 when I hit the shoot button, the next animation should start on frame 6.

I keep trying and I have no idea what to do to make it work.

DaviBraid | 2021-12-05 21:55