Swap materials
هذا المحتوى غير متوفر بلغتك بعد.
When to use this
Section titled “When to use this”Use a material swap when a whole material should change: another texture for a jacket, a metal version of a part, or a second colour set you made as its own material.
To change one value of the material you already have, such as its colour or glow, see Change a colour or glow. It needs no second material.
This needs Advanced mode, the default. In Simple mode, + Add effect does not offer material swaps.
-
In the Hierarchy, select the object that holds your AvatarDoc component.
-
In the inspector's toolbar, press + Toggle.
-
In the toggle's panel, type a name into Name, such as Metal jacket, and press Enter.
-
In the toggle's panel, press + Add effect, then Materials.
You should now see a Materials section with an empty row and Slot at 0.
-
On the row, drag the mesh from the Hierarchy onto the renderer field. You can also press the small circle at the field's right end and pick it from a list of your avatar's meshes.
-
Set Slot to the number of the material slot to swap.
Slots count from 0. In the mesh's own renderer component, the Materials list shows them as Element 0, Element 1 and so on.
-
From the Project window, drag the new material onto the material field of the row.
In the picture, 1 is the renderer, 2 the Slot and 3 the material the slot gets while the toggle is on.
To swap more than one slot, or slots on several meshes, add a row for each with + Add.
While the toggle is off, each slot shows the material it has in the scene.
Check it worked
Section titled “Check it worked”- In the toggle's panel, press On and Off in the Scene preview row. The Scene view shows the material change. Press Default to stop the preview.
- In Play mode with Gesture Manager, press the toggle in the menu, as in Your first toggle.
If it does not work
Section titled “If it does not work”- A warning says the toggle has a missing target: the row has no renderer, or its slot number is past the mesh's last slot. AvatarDoc skips that row. See the message.
- The wrong part of the mesh changes: the slot number points at another material. Count the slots from 0 in the mesh's renderer component.
- The material changes back during an animation: another toggle or animation on the avatar swaps the same slot.
Related
Section titled “Related”- Material slots describes every field of the row.
- Change a colour or glow changes one value instead of the whole material.
Docs for AvatarDoc 0.7.1