Hey all
I wonder what is a better way to animate my character. I have everything kind of working, but the code is ugly and repetitive.
My character has many simple sprites. A few of them consists of modular body parts, while the rest are whole. These are not in a spritesheet, but individual .png's. As per the first pic attached, I add dozens of AnimatedSprite2D nodes to my character, each having its own sprite. I also have an AnimationPlayer with all the animations. Everything works great, except, ALL the sprites are shown at the same time so I have to manipulate the code to show/hide the sprites, depending on what the character is doing.
This is becoming tedious, as adding a new sprite/animation means I have to add conditions to address this new animation in so many areas of my code. I'm obviously doing it wrong and missing something simple.
I initially tried using just one AnimatedSprite2D node (second pic) with all the animations, but I can't use these meaningfully in the AnimationPlayer, especially with the 'modular' body parts. I also looked at the AnimationTree but this doesn't seem like it'll help, also looks like dealing with even more code.
The last pic shows what I need to do in code when the character is "falling" versus "grounded", and I have not even added all the other animations yet lol.