Godot AnimatedSprite or AnimationPlayer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Huanter
:warning: Old Version Published before Godot 3 was released.

If I understand this right. There are two ways to create animation in Godot and I don’t know which one is preferred. Currently I am building a game with a pixel art style. I used only the node2d AnimatedSprite for my animation. Since my image are separate one by one (e.g idle1.png, idle2.png). And Its easier to add the images on animatedSprite. In the tutorial. Its uses AnimationPlayer, I haven’t used animationplayer yet, and don’t know the use of it since there is animatedsprite.

What is the difference between the two? are there any performance advantage with the other one? and when to use each one of them.

Thanks.

:bust_in_silhouette: Reply From: Zylann

I would say AnimatedSprite is mostly a shortcut for frame-by-frame animation, which makes it easier to do. AnimationPlayer is indeed more cumbersome to use for that, because it is a general-purpose animation node (it can animate frames but also any property such as position, scale, color, with curves etc). They both do the job anyways, use the node that suits your case the best :slight_smile:

Side note: you can still use the same texture atlas with AnimatedSprite by creating AtlasTextures from the inspector, or defining ImageGroups in the export settings.