PO/Library/PackageCache/com.unity.2d.animation@5.0.7/Documentation~/CharacterParts.md

1.5 KiB
Raw Blame History

Changing Parts of a Character

You can use Sprite Swap to quickly change only one Sprite on the character Prefab without affecting the other Sprites. This means you can alter part of a characters appearance (for example, change a scarf to a different color) while the rest of the character remains the same.

In the following example, we have two Sprites that are variations of the characters scarf - one green and one blue. This workflow demonstrates how to switch from one to the other in the same Prefab.


Left: The original green scarf. Right: An alternate blue scarf.

  1. Place the Sprites for both scarves into the same Sprite Library Asset, and add them both to the same Category named Scarf. You can do this directly in the Skinning Editor via the Sprite tab in the Sprite Visibility panel.

  2. Give each of the Sprites a unique Label.

  3. In the Scene, select the character Prefab and then select the Scarf GameObject the Hierarchy window.

  4. Go to the Sprite Resolver component of the Scarf GameObject. The Sprite Resolvers visual selector displays the two Sprites available in the Scarf Category.

  5. Select the blue scarf to switch the Sprite rendered by the Scarf GameObject to it instead.


    Sprite Resolvers Label set to blue scarf.