so to have multiple animation, I needed multiple sprites, but for this to work I need only one sprite shown at one time and the rest hidden. This is my attempt (obviously not working). How can I make it so that the code detects if a particular animation is playing and then accordingly hide a show sprites.
func _process(_delta):
if Input.is_action_just_pressed("LMB"):
_animation_player.play("jab")
elif Input.is_action_just_pressed("RMB"):
_animation_player.play("cross")
func punch_process(_delta):
if _animation_player.play == false:
get_node("PlayerJab").set_hidden
get_node("PlayerCross").set_hidden
elif _animation_player.play("jab") == true:
get_node("PlayerJab").set_visible
elif _animation_player.play("cross") == true:
get_node("PlayerCross").set_visible