Skip to main content

Avatar Animations

Developers are able to animate Avatars with default animations, as well as adding custom animations.

Default Animator Controller and Animations

The Dev Kit includes a default animator controller and set of animations. They can be found in the Assets > GeniesSdk > Animation folder.

The folder includes:

  • Animation clips for running, walking, idle, and jumping
  • Animator controller for being idle, moving, and jumping named IdleJumpRunWalk

IdleJumpRunWalk

Custom Animations

Any animations created for Unity's humanoid avatars are compatible with Genies Avatars. To ensure compatibility between animations created for humanoid avatars and Genies avatars, you need to include custom parameters in the animator controller used with the UserAvatar component. Follow the steps below to create a new compatible animator controller or add the custom parameters to an existing one.

Create New Compatible Animator Controller

  1. In the Project window, right-click anywhere and select Create > Genies SDK > Avatar Animator Controller.
  2. This action will generate an empty controller with the necessary custom parameters for facial animations.

Add Custom Parameters to Existing Animator Controller

  1. Right-click on the existing animator controller you want to enhance.
  2. Select Genies SDK > Add face animation parameters to include the required custom parameters.

Facial Animations

Please note that official support for facial animations is not yet available.

TypeScript Example

Here is an example script that sets the Animation Controller to a newly loaded Avatar and sets the idle_run_walk animator parameter to 1.5 which make the Avatar start a running animation since it is the highest value in the animation blend tree.

import { MonoBehaviour, RuntimeAnimatorController, Animator } from "UnityEngine";
import { GeniesSdk } from 'Genies.Components.SDK.Core';
import { UserAvatar } from "Genies.Components.Sdk.External.Avatars";

export default class MyScript extends MonoBehaviour {

@SerializeField private myAnimator: RuntimeAnimatorController;

private async Start() {
//Initialize the SDK
await GeniesSdk.Initialize();
//Create User Avatar component and load Avatar
let myAvatar = await UserAvatar.CreateAndLoadUserAvatar();
//Sets the Animator Controller
myAvatar.SetAnimatorController(this.myAnimator);
//Gets the Animator component and sets the parameter to run
myAvatar.GetComponentInChildren<Animator>(true).SetFloat("idle_run_walk", 1.5);
}
}