0 votes

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.

asked Jan 9 in Engine by Huanter (14 points)

1 Answer

0 votes

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 :)

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.

answered Jan 10 by Zylann (10,718 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.