• RuntimesUnity
  • Repalce attachment in skletonAnimation with multiple materials

Hi, I am trying to replace specific attachment in slot with another image sprite during runtime, I looked up carefully with the Mix and Match equip Example, And I managed to learn how to do it.

But my issue is , My SkeletonAnimation use multiple materials, so yes I can replace the specific attachment with outside image, I can't render my animation properly,


I assume that is because I can only input one material in the method Attachment.GetRemappedClone(),

Is there any suggestion for replace attachment in spineAnimation with multiple materials?
Thanks, I use 3.8 by the way

Related Discussions
...

So I think the question can be simplified as : can I replace specific attachment with external image, if my Skeleton Animation uses multiple materials, or multiple sub meshes, thanks!

@thris00 See the documentation of the method parameter:

/// <param name="sourceMaterial">The source material used to copy the shader and material properties from.</param>

The sourceMaterial parameter is only used for copying the shader and material properties. You specify the desired material "properties" here that you want for your new single attachment. Also, a single attachment will consist of only one attachment image, thus never require two or more materials.

    Harald Thanks Harald, you are right, I tested to delete all other Skins to make my skeletonAnimation use only one material(output all spine sprites in one big png file), but it still look like this

    So I guess, material is not the problem here...

    Ok, I found My issue, After replaced my attachment, I need to Add the new skin with replaced attachment, instead of just using the new Skin as the only Skin, because the new Skin only have a replaced attachment and nothing else