Press F5 or click to test play. The stick figure should be moving.
To revert to the original, repeat steps 4–5 using the file at templates > objects > characters > P_01 > P_01_mat_000.png in your file system.
Explanation
Meaning of Each Node
BoneAnimationRoot2D: A node used by ACTION GAME MAKER’s features (such as filters and afterimages) to recognize 2D bones. Skeleton2D and Polygon2D must be placed as children of this node.
Skeleton2D: A Godot node representing the 2D bones themselves. The textures set in the following Polygon2D nodes deform according to the position and rotation of these bones.
Polygon2D (Mantle_down ~ Hand_R): A Godot node used to define polygons for 2D bones.
Polygon2D and Textures
Each Polygon2D uses the UV feature to extract and utilize a portion of a shared single image. Let’s take a look.
Since the position and shape data of the configured UVs remain unchanged, you can easily swap the skin by creating a skin image with the same size and placed in the same position.
Custom Skin Guide
The corresponding parts of the default skin image are as follows: P_01_mat_000.png
Click on the part labeled 001_Idle. There are 47 animations registered, so try playing one you like. You should see the character move in response to the white and yellow bones. These bone movements are controlled by tracks at the bottom.
Let’s create a new animation. Click Animation at the top of the panel and select New.
Although the animation has been added, the tracks are empty. Let’s add tracks. Select all Bone2D nodes from B_Hip to B_Chain, which are children of BoneAnimationRoot2D > Skeleton. Then, click the icon (Insert Key) button on the top toolbar.
A prompt will ask if you want to create 42 new tracks. Select Create as is. This adds tracks to the new animation. These 42 tracks control the position and rotation of each of the 21 bone nodes.
Let’s edit the tracks. The blue vertical bar indicates the current playback position. It should be at 0 seconds, so drag it to around the middle, approximately 0.6 seconds.
Once you’ve decided on an angle, press the icon at the top again. It may seem like nothing happened, but the current rotation value has been saved at the 0.6-second mark.
Press the play button. The character’s arm should move slowly from its initial position to the angle where you inserted the key. The movement between the initial position and the specified position is automatically interpolated. Essentially, you create poses like playing with a doll, insert keys, and that becomes an animation.
Continue with the Graphics Course here!
Explanation
Animation Length and Looping
The animation length can be changed using the icon in the top-right corner.
The icon next to it is the loop function. One click enables looping playback, a second click enables ping-pong (back-and-forth) playback, and a third click disables looping.
Using the Added Animation in Visual Script
To use it in Visual Script, you must register it in the Animation Set of the GameObject node.
Select Player in the Scene window.
Press the Batch Register Animations button in the Inspector.
The animation is now registered in the Animation Set and can be used in Visual Script. > You can also expand the Animation Set to see which animations are registered.
Extending 2D Bone Animation
This tutorial explains only the most basic operations. Godot’s AnimationPlayer is highly powerful and includes many useful features for handling 2D bone animation, such as IK functions. For more details, please refer to the official Godot documentation below. https://docs.godotengine.org/en/4.x/tutorials/animation/cutout_animation.html