تخطَّ إلى المحتوى

Swap materials

هذا المحتوى غير متوفر بلغتك بعد.

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.

  1. In the Hierarchy, select the object that holds your AvatarDoc component.

  2. In the inspector's toolbar, press + Toggle.

  3. In the toggle's panel, type a name into Name, such as Metal jacket, and press Enter.

  4. 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.

  5. 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.

  6. 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.

  7. From the Project window, drag the new material onto the material field of the row.

    A Metal jacket toggle's Materials row with 1 the renderer, 2 the slot number and 3 the material it puts in that slot.123

    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.

  • 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.
  • 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.

Docs for AvatarDoc 0.7.1