So I have an AnimatedSprite with two animations, both 4 frames with 15FPS.

Say I want to suddenly change from animation A to animation B to the same exact spot, so that animation B would end exactly when animation A would have.
How would I proceed?

I can go to the same frame number like this:

var frame = player.AnimatedSprite.frame
player.AnimatedSprite.animation = "AnimationB"
player.AnimatedSprite.frame = frame

but even then the animation will take more gameplay frames than it should.

The AnimatedSprite frame value is int, so I can't access how far exactly the animation is between the frames.
I could do this in Gamemaker where the sprite's frame value was in float IIRC.

Is there a way to do this in Godot?

Assuming it takes 1 frames worth of time for the change to take effect you should probably do a player.AnimatedSprite.frame = frame + 1 but I'm just making a wild guess here. Note that if you are doing this in _process() then you have the delta value to work with.

    22 days later

    Megalomaniak

    Thanks for the input. I ended up using a combination of Sprite+AnimationPlayer nodes like in this article:
    https://docs.godotengine.org/en/stable/tutorials/2d/2d_sprite_animation.html

    Getting the exact same timestamp in another animation of same length happens like this:

    var pos = player.AnimationPlayer.current_animation_position
    					player.AnimationPlayer.play("Punch")
    					player.AnimationPlayer.seek(pos, true)
    					player.AnimationPlayer.advance(0)