So I'm trying to implement a slide feature in my platformer where if the player presses crouch while running they'll do a slide animation. I want the animation to play for a fixed duration, regardless of player inputs. I'm trying to use the yield function to wait until the animation is done, but I'm getting an error that says 'Error connecting to signal: finished during yield(). Any ideas where I've gone wrong?
Slide function for reference:
if is_on_floor() and velocity.x != 0 and Input.is_action_pressed("crouch"):
$AnimationPlayer.play(https://AnimationPlayer.play)("slide")
yield($AnimationPlayer, "finished")