Search Feedback

78
votes

Change Avatar Mask in Runtime

Animation

-

-

Allow scripting api to change the avatar mask on layer by script.

It would prevent duplicating layers with the same scheme but different mask (e.g. Switching from FPC to TPC )

Comments (3)

  1. D9bf84b68ec0f7c0005424b37e234c02?d=mm

    dudeLzy

    Sep 27, 2018 03:37

    Instead of changing the mask, I tried changing the active humanoid parts in the mask itself and it works
    <code>
    void ChangeMask(AvatarMask newMask, AvatarMask activeMask)
    {
    //for (int i = 0; i < activeMask.transformCount; i++)
    //{
    // //activeMask.SetTransformActive(i, newMask.GetTransformActive(i));
    // activeMask.SetHumanoidBodyPartActive((AvatarMaskBodyPart)i, newMask.GetHumanoidBodyPartActive((AvatarMaskBodyPart)i));
    //}
    for (AvatarMaskBodyPart part = AvatarMaskBodyPart.Root; part < AvatarMaskBodyPart.LastBodyPart; part += 1)
    {
    activeMask.SetHumanoidBodyPartActive(part, newMask.GetHumanoidBodyPartActive(part));
    }
    }
    </code>

  2. D9bf84b68ec0f7c0005424b37e234c02?d=mm

    dudeLzy

    Aug 13, 2018 11:44

    I really need this, would be such a great thing to have

  3. 95fef25e794ce58af1716cb0ffb6f5b6?d=mm

    platinio2007

    Jun 21, 2018 22:54

    yes we need this :(

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(10889)

2D

(287)

Ads

(57)

AI & Navigation

(81)

Analytics

(130)

Animation

(406)

Asset Store

(364)

Asset Store Publisher

(19)

Assets

(551)

Audio

(185)

Cloud Build

(148)

Collaborate

(68)

Docs & Tutorials

(247)

Editor

(2545)

Everyplay

(17)

Game Performance Reporting

(21)

General

(987)

Graphics

(894)

GUI

(442)

Input

(173)

Licensing

(93)

Networking

(190)

Physics

(387)

Platforms

(445)

Profiling & Optimization

(84)

Runtime

(185)

Scripting

(1141)

Terrain

(174)

WebGL

(142)