How to change the sprites of the player using AnimationPlayer?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DarlesLSF

Hello all, I was using AnimationPlayer to set the sprites of my player when it walks, but when I try to do the same to change the sprites in battle, doesnt work. Inside the “sprites_batalha” are all sprites I will use in the battle.
enter image description here

I tried to use $Jogador/AnimationPlayer.play("batalha_normal") but dont work. How can I do that?

:bust_in_silhouette: Reply From: Gabriel

Did you create the animations on the animation tab?

Also if the sprites under the node “sprites_batalha” are the sprites of your animation you don’t need them there, just use the button of the image above. Unless you are doing your animation by hiding and showing these sprites. if that is the case you could use something like:

$sprites_batalha/batalha_normal.show()

to show the sprite and

$sprites_batalha/batalha_normal.hide()

to hide it.

More information here