Unity SDK
Load your Ava-Twin avatar into any Unity scene in minutes. The SDK handles customizer integration, GLB downloading, humanoid setup, animations, and caching.
Installation
Install via Unity Package Manager (UPM) using a Git URL:
- 1. In Unity, open Window → Package Manager.
- 2. Click + and select Add package from git URL…
- 3. Paste the following URL and click Add:
https://github.com/waqaszs/ava-twin-unity-sdk.git#v1.0.0
Demo Scene
The SDK ships with a ready-to-play demo scene. After installing, open Window → Package Manager, select the Ava-Twin SDK, go to the Samples tab, and click Import next to Demo Scene.
Quick Start
- 1. In Unity, go to Ava-Twin → Setup from the menu bar. Enter your App ID and API Key from your dashboard.
- 2. Call
await SDK.OpenCustomizerAsync()to open the customizer and receive the avatar:
using AvaTwin;
using UnityEngine;
public class AvatarLoader : MonoBehaviour
{
[SerializeField] private Transform playerTransform;
[SerializeField] private Animator animator;
async void Start()
{
var result = await SDK.OpenCustomizerAsync();
if (result != null)
{
result.Root.transform.SetParent(playerTransform);
var humanoid = result.GetUnityHumanoidAvatar();
if (humanoid != null)
{
animator.avatar = humanoid;
animator.Rebind();
}
}
}
}Credentials ScriptableObject and exclude it from version control via .gitignore.API Reference
CharacterLoader — Methods
CharacterLoader — Events
SDK.OpenCustomizerAsync() or SDK.LoadAvatar() instead.CharacterLoader — Properties
CharacterLoader — Inspector Fields
SDK — Static Methods
The SDK static class provides the primary async/await API for loading avatars. These are the recommended entry points for most use cases.
using AvaTwin;
using UnityEngine;
public class QuickLoad : MonoBehaviour
{
[SerializeField] private Animator animator;
async void Start()
{
var result = await SDK.OpenCustomizerAsync();
if (result != null)
{
result.Root.transform.SetParent(transform);
var humanoid = result.GetUnityHumanoidAvatar();
if (humanoid != null)
{
animator.avatar = humanoid;
animator.Rebind();
}
}
}
}AvatarResult
Returned by SDK.OpenCustomizerAsync() and SDK.LoadAvatar(). Contains the instantiated avatar and metadata needed for animation, persistence, and networking.
AvaTwinCharacterController
A third-person character controller included in the SDK demo. Drives a humanoid Animator with four parameters: Speed, Grounded, Jump, and FreeFall.
AvaTwinInput
Input data struct consumed by AvaTwinCharacterController.