Is there any way to control the Slot Draw Order between 2 Separate SpineSprite instances (2 CharacterBody2D)
For example, Character 1's Right Arm is in front of Character 2. Character 1's Left Arm is behind Character 2.
Is there any way to control the Slot Draw Order between 2 Separate SpineSprite instances (2 CharacterBody2D)
For example, Character 1's Right Arm is in front of Character 2. Character 1's Left Arm is behind Character 2.
skarasuko A SpineSlotNode
can be used for this purpose. It allows you to insert your own nodes into the drawing order of a SpineSprite
. It can be used to attach other SpineSprite
nodes to specific slots of the skeleton, as shown below:
See the documentation for more information:
https://esotericsoftware.com/spine-godot#SpineSlotNode
Misaki How does this look in the Editor or Code? Would this be a lot of work if I wanted to manage hundreds of Slots? I want to see if I can specify the Draw Order of multiple SpineSprites while they sync to 1 animation.
I do not know if I can make the Slots of the 2nd SpineSprite go in-between the Slots of the 1st SpineSprite.
skarasuko If you want to know how SpineSlotNode
works, you may find the explanation starting at 16:44 in the following video helpful:
SpineSlotNode simply follows for a particular slot. This includes changing the order in which the slots are drawn. For example, as demonstrated in the video below, a SpineSlotNode's child nodes will follow the slot even if the slot's drawing order changes during animation:
Misaki I'm understanding this a bit, but is it too difficult to manipulate several number of Slots's Draw Order in a detailed manner with 2 Spine Sprites? Something like this:
S1: Right Arm in front of S2's Torso.
S1: Left Arm behind S2's Torso
S2: Left Arm in front of S1's Torso
S2: Right Arm in front of S1's Torso
I don't necessarily need to use 2 CharacterBody2D (scene), since I only need to sync the same animation in an extra SpineSpriteNode. I'm trying to simulate character interactions so their limbs go where I need them to.
Although, ideally, it would be nice to control the Draw Order of the Slots between 2 CharacterBody2Ds.
Not possible without diving into source C++. It isn't top priority so it will take a while if it ever gets done.
skarasuko In fact, it would be a bit difficult to handle a case where, for example, two characters normally move separately, and one character is temporarily placed between the other's drawing order for a hug animation. The idea of SpineSlotNode
is to insert something into a skeleton, not to separate the rendering of the skeleton. In the case of spine-unity, the skeleton rendering can be separated by a component called SkeletonRenderSeparator
, which can be enabled or disabled. Unfortunately, SpineSlotNode
cannot be enabled or disabled in such way; it can only be toggled on and off to display the inserted nodes.
I thought this was an issue we should consider, so I have created an issue ticket below to add this enhancement: EsotericSoftware/spine-runtimes2689
You can subscribe to this issue ticket to receive notifications when there is any progress on this issue.