Guys, I think you might be posting about different issues.
@RJ Forbes
Animations reference the skin to know what to attach.
You can...
a) Add the newly created attachment to the skeleton's skin (which will affect all other instances of that same skeleton). or...
b) clone the skin and add your newly created attachment to that. or...
c) Use a variation of the code you're using:
Spine.Slot gunSlot;
Attachment CurrentGun;
void Start () {
//...
StarKidRenderer.skeleton.FindSlot("gun slot name"); // Cache the slot so you don't need to find it every frame
StarKidRenderer.UpdateLocal += UpdateLocal;
//...
}
void UpdateLocal () {
gunSlot.Attachment = CurrentGun;
}
Options A and B rely on a setup where you keyed the attachment visible at the correct times in the animations. This is ideal if your animations frequently show and hide the weapon. If your weapon is always visible, option C will work just fine.
Note that SpriteAttacher was mostly made as a sample and quick-use component if nothing ever touches the slot it tries to attach to. If anything else modifies the slot like animations or your code, you need to use some other way.
For example, you would not build an entire equip system with or on top of SpriteAttachers. It would be highly inefficient.
@[удалено]
I'm still not able to replicate the bug.
Are there no error logs in the console?