In ACTION GAME MAKER, the only node available for animation playback in Visual Scripts is AnimationPlayer
.
You cannot directly play animations with AnimatedSprite2D
, which is a node in Godot specialized for sprite sheet animations.
Although AnimationPlayer
can play sprite animations, managing many sprite sheets becomes cumbersome.
Here are two recommended methods to effectively use AnimatedSprite2D
.
1. Use AnimatedSprite2D as a Sprite Repository and Control It via AnimationPlayer
This method treats AnimatedSprite2D
as a storage for sprite sheets and accesses its properties through AnimationPlayer
.
If you’re open to using plugins, Method 2 is generally recommended.
Setting Up AnimatedSprite2D
- Add an
AnimatedSprite2D
node. - Select the node and create a new
SpriteFrames
resource. - In the SpriteFrames panel at the bottom, create as many animations as you need.
- Select an animation and click Add Frames from Sprite Sheet.
- Choose the sprite sheet and split it correctly using the slicing menu.
- Select the frames in the desired order.
- Repeat steps 4–6 for each animation.
Loading into AnimationPlayer
- Create the necessary animations in
AnimationPlayer
. - Click Add Track > Property Track.
- Select the
AnimatedSprite2D
node. - Add the
animation
andframe
properties (add one at a time). - Insert a key at 0s in the
animation
track and select the animation name in the Inspector. - Insert frame keys in the
frame
track to define the animation sequence.
2. Use the Plugin: godot-animated-sprite-2-player by pocchi the dev
(This method was introduced by Justus Pan. Special thanks to pocchi the dev for this excellent plugin.)
This plugin lets you automatically import animations created in AnimatedSprite2D
into AnimationPlayer
.
Creating Animations in AnimatedSprite2D
- Follow the setup steps from Method 1.
- Configure the animation:
- FPS: Determines how many frames display per second.
- Loop Setting: Enabled by default.
- Frame Duration: Multiplier to control the duration per frame (e.g., Duration = 2 at 5 FPS = 0.24s instead of 0.12s).
- Once all animations are set, you’re ready to import.
Enabling and Using the Plugin
- Download the plugin or use the ZIP provided.
- Unzip and place the
addons
folder into your project root. - In the editor, go to Project > Project Settings > Plugins and enable “Animated Sprite to Player.”
- Select the
AnimationPlayer
node. - Use the new Import AnimatedSprite2D/3D menu, select the correct
AnimatedSprite2D
, and click Import. - Your animations will be auto-converted to
AnimationPlayer
format, with proper durations and loop settings. - You can further tweak the animations in
AnimationPlayer
. - If you change the original
AnimatedSprite2D
, just re-import to update.
Note: This plugin must be re-enabled separately for each project where it’s used.