I have connected the signal on_spine_sprite_animation_ended to my script in Godot, and it seems to work fine. However, I want to call the print() function only when the animation that has ended is the 'Side Attack' animation:
var current_entry = animation_state.get_current(0).get_animation().get_name()
func _on_spine_sprite_animation_ended(spine_sprite: Object, animation_state: Object, track_entry: Object) -> void:
if current_entry == "Side Attack":
print("Attack")
Currently, as I check the current animation, print() gets triggered at the beginning of 'Side Attack' rather than when it ends because it identifies the current animation instead of the one that has ended. Is there a way to check for the animation that has just ended, similar to how you can do with AnimatedSprite2D in Godot?"