TeslasuitDocumentation
Plugins

Suit mocap

Windows · Unity 6000.0.44f1 · Plugin 2.6.0 · Requires Teslasuit Studio

This example retargets a full-body Teslasuit motion stream onto a character in the scene. It shows how a motion provider, an avatar settings asset, and the human animator combine to move a rig in real time. The scene is TS/Examples/Scenes/Mocap/SuitMocap.unity.

What it demonstrates#

Scene setup#

The scene has a character (the Ethan model in the shipped example) with three pieces on or referenced by its root:

Component or assetRole
TsSuitBehaviourDiscovers the suit and reports connection state.
TsLiveMotionProviderStarts the suit Mocap and exposes the live ISkeleton.
TsHumanAnimatorReads the skeleton each frame and applies bone rotations, plus hip position for the root.
TsAvatarSettingsMaps each TsHumanBoneIndex to a named transform on the rig, and stores the I-pose rotations.

The example's EthanAvatarSettings asset is bound to the Ethan model, so it is a reference only. For your own character you author a new avatar settings asset that maps the suit bones to your rig's transforms.

The key API pattern#

On start, TsHumanAnimator validates the avatar settings and caches the transform for each suit bone. Each frame it reads the skeleton and applies rotations relative to the I-pose.

private void Update()
{
    var skeleton = m_motionProvider.GetSkeleton(Time.time);
    foreach (var boneIndex in TsHumanBones.SuitBones)
    {
        var poseRotation = m_avatarSettings.GetIPoseRotation(boneIndex);
        var targetRotation = Conversion.TsRotationToUnityRotation(
            skeleton.GetBoneTransform(boneIndex).rotation);
        // boneTransform.rotation = targetRotation * poseRotation
    }
    // root follows the hips position from the skeleton
}

Setting the animator's IPose flag calibrates the provider, capturing the wearer's current stance as the reference pose. See Mocap concept for why calibration matters.

Authoring your own avatar settings#

  1. Create an asset from the menu Assets/Create/Teslasuit/Motion/Avatar settings.
  2. Assign your character model and fill in the bone-to-transform mapping. The editor validates that all required suit bones are configured.
  3. Reference the asset from a TsHumanAnimator on your rig, alongside a TsLiveMotionProvider.

Note. If the animator logs invalid or missing avatar settings, a required bone mapping is not set. TsAvatarSettings.IsValid must be true before the animator runs.