+7 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.


in Engine by (21 points)

1 Answer

+5 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.

by (28,833 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.