Thanks for the zip package, we received everything. We will get back to you as soon as we've figured out what's going wrong.
Now I noticed the problem's cause, actually it was at display in your postings above already, I just did not see it.
The problem is that you are using 3 separate skin placeholders for the weapons with one target attachment each, where you should rather be using one skin placeholder with one skin for each weapon. The concept of skin placeholders is explained here, also mentioning that it should be head
for all heads and not red head
for a specific one. Alternatively, you could also not use skin placeholders at all and add the attachments for each sword below the bone directly. The latter is demonstrated in the Goblins
example project and the spine-unity example scene Spine Examples/Other Examples/Goblins
.
The problem in the code below is that you are querying the attachment at Quick
/sword2
and then assigning the same returned attachment to Quick
/sword2
again - which has no effect.
Attachment weaponAttachment = customSkin.GetAttachment(weaponSlotIndex, weaponSpineName);
..
customSkin.SetAttachment(weaponSlotIndex, weaponSpineName, weaponAttachment); // this is where it HURTS !
// this equivalent to:
var a = b;
b = a;
If you have multiple skin placeholders at a single slot, the active skin placeholder is not changed by assigning a different skin to it. The active skin placeholder could e.g. be switched by an animation, for example to switch from a happy face to a neutral one. You could then switch from e.g. a male to a female skin and have the respective happy and neutral face images updated all at once, but its visibility (happy or neutral face active) is still caused by the animation.
In your code, you have the happy face
active (skin placeholder sword01
) and assign something to neutral face
(skin placeholder sword02
), but nothing changed the active placeholder from happy face
to neutral face
.
Skin placeholders can be confusing, I hope this example explains it a bit.