@VOXELIUM Thanks for uploading the video. In your video you can see that when you're entering play mode and before enabling the SkeletonAnimation
component, the assigned material is Weapon_01_Material (Instance)
. So any of your components seems to have modified the material and thus created a material instance. After the material was modified and a material instance (clone) is assigned, when the SkeletonAnimation
component is activated, it assigns materials based on active attachments, which resets the material to the shared original material in your assets folder.
Please see the documentation below, especially the "Note" section reading:
"Note: Direct modifications to the Materials array have no effect "
https://esotericsoftware.com/spine-unity#Materials
https://esotericsoftware.com/spine-unity#Changing-Materials-Per-Instance
VOXELIUM I tried using SkeletonRendererCustomMaterials
It didn't help
Then you likely did something wrong.
Most likely you are modifying the material via code and thus creating the Material instance. If you don't want to prepare material assets and assign them, but instead want to change properties via code at runtime, you should be using MaterialPropertyBlocks
. Again, see the documentation on how to do that:
https://esotericsoftware.com/spine-unity#Changing-Materials-Per-Instance