I am new to Godot and I have searched for this question on reddit and here, but the answers are not working for me.
I have separated my player's body parts (bodies, heads, mainhands, secondhands) into different frames but they are in one texture. The reason I have done this is that I want each body part to play a different animation based on the situation. For example when the player is holding a staff and running I want
MainHandAnimation to show hold animation while the rest of the body parts show run animation.
To solve this I made a
Sprite with 4 different
AnimationPlayer nodes as its children. Each
AnimationPlayer is for one body part only. In the player's script I play animations after each other but instead of showing all the body parts at once the sprite only shows the lowest
For example in a structure like this:
------------ BodyAnimation (=AnimationPlayer)
------------ SecondHandAnimation (=AnimationPlayer)
------------ HeadAnimation (=AnimationPlayer)
------------ MainHandAnimation (=AnimationPlayer)
Running this code will only Show
MainHandAnimation and not the other ones.
$Sprite/MainHandAnimation.play("hold" if is_holding else "walk")
The frames have transparent background so they should be shown on top of each other without any problems.