How to Install the Union Avatars SDK into Your Unity Project

Union Avatars SDK promotional image showcasing a low-poly high-quality avatar with features like AI avatar creation from a selfie, advanced animation support, and layout customization. The image includes a "Download on the Asset Store" button.

Integrating avatars into your Unity project can significantly enhance your game’s user experience. Union Avatars SDK simplifies this process, allowing you to add customizable avatars with ease. This guide will walk you through installing and importing the SDK, setting up the necessary API key, and using samples to add avatars to your game using a user interface. Let’s dive in and get started!

Part 1: Installing & Importing the SDK / Create & Save API Key

Drag and Drop the Unity SDK Package in Your Unity Project

To begin with, you need the Union Avatars SDK package. Download it from the official website or repository. Once you have the package:

  1. Open your Unity project where you want to integrate the SDK.
  2. Drag and drop the Unity SDK package into your project’s Assets folder. This action will initiate the import process.

Install Draco Dependencies

After importing the SDK package, Unity might prompt you to install additional dependencies:

  1. Wait for the import process to complete.
  2. When prompted, press “Okay” to install Draco dependencies. These are crucial for the proper functioning of the SDK.

Project Setup in Unity

Next, you need to configure the SDK within Unity:

  1. Navigate to the Top Bar > Union Avatars > Project Setup.
  2. Enter your credentials as required.

Generate and Save the API Key

Generating an API key is essential for utilizing the Union Avatars services:

  1. Within the Project Setup, generate an API key.
  2. Save the API key immediately, as you won’t be able to see it again. You can easily copy it from the Editor Console.

Part 2: Importing & Using Samples

Accessing the Package Manager

To use the samples provided by Union Avatars, follow these steps:

  1. Go to Window > Package Manager.
  2. In the Package Manager, select Union Avatars from the list.

Installing Samples

Union Avatars SDK comes with various samples that demonstrate how to use different features:

  1. Under the Union Avatars section, go to Samples.
  2. Install the samples you wish to use in your project.

Locating and Using Samples

After installation, the samples will be available within your project:

  1. Navigate to the Samples folder in your project.
  2. Explore the samples to understand their implementation and integrate them into your project.

Part 3: Adding Avatars to Your Game Using Our UI

Initial Setup

For this example, we’ll assume you have a basic setup with a character that uses a humanoid Animator Controller and a Player Movement script.

  1. Import the UI sample from the Union Avatars samples you installed earlier.

Adding the UI Prefab

Integrate the UI prefab into your scene:

  1. Add the UI prefab to your scene from the imported samples.
  2. Fill in the organization variables as required for your project.

Editing the Script

To connect the UI with your character, you need to modify the script:

  1. Create a variable for the Animator Controller in your script:
public RuntimeAnimatorController animController;
  1. In the SetupAvatarObject function, assign the Animator controller and Player script to the avatar:
avatarObject.GetComponent<Animator>().runtimeAnimatorController = animController;
avatarObject.AddComponent<PlayerMovement>();

Final Steps

Now, ensure your scene is set up correctly to use the new avatars:

  1. Disable your previous character in the scene.
  2. Press play to run the scene.
  3. If you can’t interact with the UI, add an Event System to your scene:
    • Go to GameObject > UI > Event System.
  4. Press play again, create or select one of your avatars, and start playing as your avatar.

Frequently Asked Questions

How do I obtain the Union Avatars SDK? You can download the Union Avatars SDK in our website or in Unity Asset Store. Ensure you have the latest version for compatibility.

What should I do if the Draco dependencies don’t install automatically? If the dependencies don’t install automatically, you might need to manually download and import them. Check the SDK documentation for specific instructions.

Can I use Union Avatars with any version of Unity? Union Avatars SDK is designed to work with 2020.3 LTS or later versions of Unity.

How can I get the API key? You can get access to your API key for free at the Subscription Page. Choose the type of subscription and you will receive an email with your API Key and credentials.

Why can’t I see the avatars in my scene? If avatars are not visible, check if the UI is properly set up and that the Animator Controller is correctly assigned. Also, ensure there are no missing dependencies or scripts.

By following these detailed instructions, you will be able to seamlessly integrate the Union Avatars SDK into your Unity project, providing your game with a dynamic and engaging avatar system.

Most Popular

Get The Latest Updates

Subscribe To Our Monthly Newsletter

No spam, notifications only about new products, updates.

Categories

The Future Begins With You

Open up to a realm of new possibilities with Union Avatars

Ua-2
EN_Funded_by_the_European_Union_RGB_WHITE
plan de recuperación logo
18367_214214202211593-1-1024x190

Subvencionado por el CDTI

Logo Maetd White

Financiado por el Ministerio de Asuntos Económicos y Transformación Digital

Proyecto FAV-010100-2022-21 financiado por

Mtdfp Bis Gob 1
logo 4yfn startup awards
Award Best Phygital Experience Union Avatars
logo forbes spanish company changing the world
logo cuatrecasas acelera

© 2024 · Union Avatars