I'm working on my first game, a plataformer 2d. I want to implement a ledge climb for the Player, so when they detect a ledge, they can climb it. The AnimationPlayer plays the climb_ledge animation, and once it finishes, I move the Player to a specific location (in this case the tile that's up the ledge). This is the specific portion of the code:
var target = ledge_climb_pos.get_global_position()
position = target
state = WALK
ledgeclimbpos is an Area2d that's a child of the KinematicBody2d set at the specific place where the sprite ends at the end of the animation: https://ibb.co/qsfFvVb
("reference frame" is not part of the animation, is just to illustrate where the Player should end up) After yield, I set the position of the Player to that target location. It works, but there is an extra frame of the animation that appears for a fraction of a second, as if the next animation (in this case an Idle) started playing at the target's previous location before setting the new location.
Here's a video that illustrates what I mean: https://youtu.be/_eRdaubooVo
I hope this is clear. English is not my first language.
Thanks in advance!