Creating a modular Skeleton2D turnaround in Godot - is it possible?

Godot Version

4.1

Question

Hello, Godot forum! I’ve been working on a game prototype, and I’ve been scoping out NPCs for it. For my requirements (customizable, randomly generated characters, multiple animations per character, one smaller “chibi” mode and one larger “visual novel” mode for each character), I’ve decided a 2D puppet-style isometric Skeleton2D rig would be the best option. Ideally for this kind of character you’d be working with 3D assets, but that’s beyond the scope of the project.

Here’s what a turn-around would look like:

godot demo 1
I apologize in advance for the crummy developer art. I’ve got finalized-ish assets, just not on hand. Assume that every bone is separated into their own layer, which is exported into a .PNG for later use.

I’m aware that Godot has a suite of Skeleton tools, but they don’t appear to be well documented with tutorials or example projects beyond a character facing a singular direction.

I have a couple of considerations that I hope someone could point me in the right direction to solve:

  • Is it possible to change the direction of bones inside of an AnimationTree, depending on each direction? Not all bones are positioned in the same place on each phase of the turn-around.
    godot demo 2

  • For changing the bones of each direction, I’d have to replace the sprite in each phase of the turn-around. However, I want my character to be customizable, so, for example, you could swap the character’s hair.
    godot demo 4
    This would most likely be achieved by just adding an extra hidden Hair bone (three in my case, one for the front and two for the back), and changing the sprite whenever the hair is swapped. How can I assure that the sprite won’t change back to the original whenever the character rotates, though?

  • Other customization options would include animatable objects, such as eyes.
    godot demo 3
    The eyes include blinking animations and alternate versions for wide-open eyes and eyebrows, for example. How could one go about conserving these animations while allowing you to alternate between styles? Would it have to be another AnimationTree for those, which the first, parent AnimationTree handles?

  • Is there a way to animate certain objects individually of each other? For example, a character could be in 3/4ths view while its head is staring directly down.

I’m aware Spine2D is an industry standard tool for this kind of set-up, but 370 dollars is a steep tag, and its alternative DragonBones appears to have been deprecated in around 2022. I don’t mind implementing this in Godot itself, if possible.

Did you ever figure this one out? I’m trying to do something similar using only Godot’s animation tools. I created multiple skeletons and polygons and grouped each one by direction, enabling only that ‘direction’ group and hiding the others when facing a certain way. However, that seems like a terrible way to go about it, and it also crashes my editor from time to time.

Is it possible to change the direction of bones inside of an AnimationTree, depending on each direction?

If you mean the rotation or position of the bones, you can set different values of the first key of each track for each bone for each angle in the AnimationPlayer.

How can I assure that the sprite won’t change back to the original whenever the character rotates, though?

The sprite will not change unless the AnimationPlayer’s animation has a track that specifically changes the sprite. As long as you don’t have that track, then you can do whatever you want to the bones and the sprite won’t change back.

How could one go about conserving these animations while allowing you to alternate between styles? Would it have to be another AnimationTree for those, which the first, parent AnimationTree handles?

You can swap out the animations and sprites in code. If there’s alternate animations for the eyes as well, you can have them in the same animationplayer / animationtree and just check which animation to play before playing them.

Is there a way to animate certain objects individually of each other?

You can make separate animations for the head and body. So the head animation would only have tracks for the head and the body tracks would only have tracks for the body. However, an animation player can only play one animation at a time so you’ll need one for every part of the body that will be animated separately. Alternately, you can use one animationplayer but set it up so that it calls a method you made that gets the correct values for the angle of the head/body.

wait this was from 7 months ago :skull:

well i hope i can help you at least