- Home /
Can you change the sprites of a 2d character rig (at runtime)?
I'm using the Unity's new 2d animation package (https://blogs.unity3d.com/2018/11/09/getting-started-with-unitys-2d-animation-package/) and after rigging and animating my character I'm wondering if it's possible to replace the sprites that the character rig is using. Changing the sprite used by the sprite renderer of one of the layers causes the Sprite Skin script to remove the corresponding bones:
Changing the psb file means having to redo all the rigging and geometry, which seems rather inefficient considering I only need to slightly change the sprite and keep the bones and mesh the same.
I'm fairly new to Unity so sorry if I missed an obvious solution and thanks in advance for any insight into this issue.
Answer by oscarfickel3 · Aug 30, 2019 at 04:11 PM
I did some more research and found this link which explained exactly what I wanted to do: https://docs.unity3d.com/Packages/com.unity.2d.animation@2.2/manual/2DAnimInter.html
See the documentation on sprite swapping: https://docs.unity3d.com/Packages/com.unity.2d.animation@2.2/manual/SpriteSwapIntro.html
Ok, thanks. Sprite Library Asset, Sprite Library component, Sprite Resolver component added but while change sprite affected bones are removed.alt text
"Resolver component added but while change sprite affected bones are removed.alt text" This is because the other sprite doesn't have bones added to it. You gotta copy the bones+vertexes from the other sprite and paste them in the new sprite's skinning editor.
Your answer
Follow this Question
Related Questions
2d sprite rigging control attached sprites 0 Answers
[Solved] 2D Sprite Rigging using PNG Files 1 Answer
SpriteManager 2 1 Answer
Platform Top Panel Scrolling Effect and Animation 0 Answers
Sprite animation 2 Answers