Kinetix Documentation
Website
  • 🖐️Welcome
  • 🕺About Kinetix
  • 🖌️User-Generated Emote
    • 🤖Video-to-animation AI
    • 🤸Kinetix Emote Standards
    • 🦴Retargeting
    • 🏂Kinanim (Emote streaming)
    • 🖊️Try the User-Generated Emote feature
  • INTEGRATION
    • 🤷SDK or API: what to choose
    • 🤩Kinetix SDK
      • ⚙️SDK - Core Package
      • 🧩SDK - Sample scene
      • 🧑‍💻Tested & approved Game Engines for the SDK
      • 💻SDK Integration in Unity
        • ⬇️Set-up Unity & Import the SDK
          • 🔑Get your Game authentification API Key
          • ⚙️Setup your Unity environment
          • 🔧Install the Kinetix SDK in Unity
          • ⌨️SDK Initialization - Unity
        • ⚡Quickstart - Unity SDK
        • 🦋SDK Core Modules activation - Unity
          • 🔐Account Management in Unity
          • 💃Animation System - Unity
            • 🎢Unity's Animator System
            • 🎨Custom Animation System
            • 🌳Root Motion
              • RootMotion + NavMeshAgent
            • 🎞️Frame Controller
            • 💪IK Controller
            • 🫥Avatar Mask
          • 📶Network - Unity SDK
            • Photon PUN
            • Photon Fusion
        • 🕺User-Generated Emote integration (Unity)
          • Embedding the PWA in your Unity application
          • Validation / Retake
        • 🚧How to update Kinetix SDK in Unity?
        • 📕SDK API Reference - Unity
          • KinetixCore
          • KinetixCore.Account
          • KinetixCore.Animation
          • KinetixCore.Metadata
          • KinetixCore.Network
          • KinetixCore.UGC
        • 📂Unity SDK Changelog
      • 🕹️SDK Integration in Unreal Engine
        • ⬇️Set-up Unreal Engine & Download the SDK
          • 🔑Get your Game authentification API Key
          • ⚙️Set up your Unreal Engine environment
          • 🔧Install the Kinetix SDK in Unreal
          • ⌨️UE SDK Core Package Initialization
        • ⚡Quick Start
        • 🦋SDK Core Modules activation - Unreal
          • 🔐Account Management - UE
          • 💃Animation System - UE
            • Local player system in Unreal Engine
            • Avatar system in Unreal Engine
            • Without uploading an avatar (deprecated)
              • Animation in a Third Person Template
              • Animation in an existing project
          • 📶Network - UE SDK
        • 🕺User-Generated Emote integration (UE)
        • 📕SDK API Reference - UE
          • KinetixCore
          • KinetixCore.Account
          • KinetixCore.Animation
          • KinetixCore.Metadata
          • KinetixCore.Network
        • ⬆️Updating from 0.3 to 0.4
        • 📂UE SDK Changelog
    • 😍Kinetix API
      • 🔑Get your Authentification API key
      • 🔌API routes
      • 🪝API Webhooks
      • 🏓Possible Return Codes
  • Management
    • 🚪Developer Portal
      • 👽Avatar Upload
      • 👮UGC Moderation
    • 🖌️UGE: Guides & Best Practices
      • 📐User-Generated Emote specifications
      • 👌Video recording best practices
      • 👻User-Generate Emote Use Cases
  • SUPPORT
    • 📬Bugs reports & features requests
    • ❓FAQ
      • FAQ: General questions
      • FAQ: Unity SDK
      • FAQ: Unreal Engine SDK
    • 🤕Troubleshooting
    • 📚Glossary of terms
Powered by GitBook
On this page
  • Setup an Avatar Mask
  • Runtime Avatar Mask Setup
  • Runtime Create Avatar Mask

Was this helpful?

Export as PDF
  1. INTEGRATION
  2. Kinetix SDK
  3. SDK Integration in Unity
  4. SDK Core Modules activation - Unity
  5. Animation System - Unity

Avatar Mask

PreviousIK ControllerNextNetwork - Unity SDK

Last updated 10 months ago

Was this helpful?

Setup an Avatar Mask

Create an Avatar mask.

Follow these steps in project view : Right Click> Create > Kinetix > AvatarMask

In the inspector, you can click on each individual node to enable (in green) or disable (in red) the bone. Hovering the node will show the name of the bone.

For the Mask to be applied on a character, you need to call the corrisponding SetMask method.

void SetMaskOnLocalPlayer(
    KinetixMask _Mask
);
KinetixMask GetMaskOnLocalPlayer();

Example:

[SerializeField] public KinetixMask mask;
[SerializeField] public Animator myAnimator;

//This code is from the Quickstart example
private void Awake() 
{
    KinetixCore.OnInitialized += OnInitialize;
    KinetixCore.Initialize(new KinetixCoreConfiguration()
    {
        GameAPIKey = "yourGameAPIKey",
        PlayAutomaticallyAnimationOnAnimators = true,
        EnableAnalytics = true
    });
}
    	
private void OnInitialize()
{
    KinetixCore.OnInitialized -= OnInitialize;
    
    //Register local Player
    KinetixCore.Animation.RegisterLocalPlayerAnimator(myAnimator);
    
    //Set Mask
    KinetixCore.Animation.SetMaskOnLocalPlayer(mask);
}
void SetMaskOnAvatar(
    string _PlayerUUID,
    KinetixMask _Mask
);
KinetixMask GetMaskOnAvatar(
    string _PlayerUUID
);

Example:

[SerializeField] public KinetixMask mask;
[SerializeField] public Animator myAnimator;
private string avatarID;

//This code is from the Quickstart example
private void Awake() 
{
    KinetixCore.OnInitialized += OnInitialize;
    KinetixCore.Initialize(new KinetixCoreConfiguration()
    {
        GameAPIKey = "yourGameAPIKey",
        PlayAutomaticallyAnimationOnAnimators = true,
        EnableAnalytics = true
    });
}
    	
private void OnInitialize()
{
    KinetixCore.OnInitialized -= OnInitialize;
    
    //Register local Player
    avatarID = KinetixCore.Animation.RegisterAvatarAnimator(myAnimator);
    
    //Set Mask
    KinetixCore.Animation.SetMaskOnAvatar(avatarID , mask);
}

Runtime Avatar Mask Setup

The KinetixMask can be modified in runtime using the method SetEnabled

Example:

[SerializeField] public KinetixMask mask;

private void Start() 
{
    mask.SetEnabled(HumanBodyBones.Hips, false); //Disable the hips on start
    mask.SetEnabled(HumanBodyBones.LeftHand, false); //Disable the left hand on start
    
    Debug.Log( mask.IsEnabled(HumanBodyBones.LeftHand) ) //Log: False
}

Runtime Create Avatar Mask

private void Start() 
{
    KinetixMask myMask = ScriptableObject.CreateInstance<KinetixMask>();
    //Do stuff with the mask
}
🤩
💻
🦋
💃
🫥
Create a AvatarMask asset
Kinetix Mask inspector
Masked animation example (red character)