How to smoothly transition two animation

Godot Version

ver4.3

Question

`Im making 2d sideview shooter game. I prepared two different jump animation for player. Animation 1 for regular player jump. Animation 2 for player shooting while jumping. How can I transition to Animation 1 after Animation 2 withought restaring the whole animation?

Animation 1:
new_jump 2

Animation 2:
new_jump_shootv2

`

Method 1:

var animatedSprite2d

func transition:
   animatedSprite2d.animation = "animation1"
   animatedSprite2d.frame = [*your desired frame*]

If you handly your animations with an animation player and a sprite2d this should work as well (method names may variate, just look them up in the Godot documentation)

Method 2:
Make a separate animation to transition to

I hope that helps