Animation player one Sprite with more png files

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

So i wanted to animate a player with animation player, and on the sprite i can only set one image, that’s the idle one, so when the player is standing still there’s this simple animation, however I wanted to add more animation to it, like running, jumping and so, nut i have different png files for everything. On the documentation and on some tutorials i only saw animation with AnimationSprite where i insert every frame, but that’s not in my case. And AnimationPlayer where there is used only one png file which has all the animations on Vertical frames, in my case i don’t have vertical frames, only one horizontal, and i have more png files with horizontal frames.

Do you know any way possible to add more png files to the sprite and animate them with animation player, or any other way that doesn’t require me to modify my png files into one, that has all frames?

Animation 1: idle
Animation 2: Run

Hi! you can’t add more than one texture to the sprite, but you don’t need to. You can just animate the sprite texture property to change the texture on each animation. At the beginning of the animation, assign the new texture to the sprite, and click the key icon beside the texture property so the animation changes the texture.

p7f | 2020-10-25 18:37

Thank you so much, this was helpful! If someone runs into the same problem you should also press the key next to the horizontal frame because if you have images with less/more frames and you don’t key it, it modifies all you animations with the current one you are using.

klim | 2020-10-25 19:06