yea i really needed it no signals, i found a solution actually:
func get_current_animation_length(animated_sprite: AnimatedSprite2D = animated_sprite_2d) -> float:
var current_animation_name = animated_sprite.animation
if current_animation_name == "":
print("No animation is currently playing.")
return -1.0
var sprite_frames = animated_sprite.sprite_frames
if sprite_frames and sprite_frames.has_animation(current_animation_name):
var num_frames = sprite_frames.get_frame_count(current_animation_name)
var anim_speed = animated_sprite.speed_scale * sprite_frames.get_animation_speed(current_animation_name)
if anim_speed > 0:
return num_frames / anim_speed
else:
print("Animation speed is zero or negative.")
return -1.0
else:
print("Animation not found: ", current_animation_name)
return -1.0```