My animations not working when I change sprites from Sprite Library Asset with a script.
But it work correctly when I change it in Unity Editor in play mode.
I use this code:
mySpriteResolver.SetCategoryAndLabel(clothCategory, clothes[clothIndex]);
mySpriteResolver.ResolveSpriteToSpriteRenderer();
When i change sprite with code, i get this warning in the editor in SpriteSkin component:
“the number of sprite’s bind poses and the number of transforms should match”
and when i change it in SpriteResolver component in editor, animations play correctly and the warning is gone.
I don’t have problem with all of the sprites.
Some of my clothes used only 5 bones; and some of them use more than those 5 bones.
When i select sprite with more than 5 bone, i can see all of the bones in the scene view but when i change it with script, i see main 5 bones that common in all sprites and it doesn’t show extra bones.