Hi, I'm new on Godot and I'm trying to figure out what's the best approach to managing 2D layered animation.
Here's the problem: Imagine having to animate a 2D character that is divided into three-layer or pieces (in my case layers since is a top-down game): head + body + legs.
When the character is on "idle" all the layers play the idle animation, when the player moves the character all the pieces have to travel to the "walking" status\animation.

So far is quite simple: layers have the same status\animation; the problem is when I add a third status like "attacking" that can be combined with idle: (head: idle, body: attacking, legs: idle) or walking (head: walking, body: attacking, legs: walking), in other words, the player attack while walking or while in idle.

I do have the sprites for all the pieces and all the possible statuses.

What's the most appropriate approach for building such animations (i.e. animation tree, animation player, spritesheet\spritesheets).

    Fab I would do three Animated Sprites, but make all the animations for them the same name (which I am guessing you will since they need to sync up). After that, you can just make a state machine and then match the animation in each sprite to play according to the state.

    extends Node2D
    
    ## here's your enumerator, 0 is first, 1, 2....
    enum _AnimationStates {_IDLE, _WALK, _ATTACK}
    ### here's your current state 
    var _currentState = 0
    
    
    ## this function checks state and plays according animations
    func _getAnimationState():
    	match _currentState: ## match statement to check state
    		"_IDLE": ## you could also just type 0 here...
    			$AnimatedHead.play('idle') ### then play the right animations
    			$AnimatedBody.play('idle')
    			$AnimatedLegs.play('idle')
    		"_WALK":
    			$AnimatedHead.play('walk')
    			$AnimatedBody.play('walk')
    			$AnimatedLegs.play('walk')
    		"_ATTACK":
    			$AnimatedHead.play('attack')
    			$AnimatedBody.play('attack')
    			$AnimatedLegs.play('attack')
    
    
    func _process(_delta): ## then check each frame for state changes
    	_getAnimationState()

    The problem is that the pieces should not always sync: ie I can attack while standing, I can attack while walking or running.
    In a state\transaction diagram:

    Anyway, I will try something using the things you suggested.