TeslasuitDocumentation
Plugins

Getting started

Take your first steps with the Teslasuit Unity plugin: from installing the SDK and importing the package, to adding the components that reach a connected device and its subsystems.

Requirements#

RequirementVersion
Operating systemWindows
Unity Editor6000.0.44f1 (Unity 6)
Teslasuit plugin2.6.0
Teslasuit SDKInstalled with Teslasuit Studio

Install the SDK and import the plugin#

1. Install the Teslasuit native SDK#

The plugin does not ship the native libraries inside the Unity project. Those libraries come from a separate Teslasuit SDK installation, which is installed with Teslasuit Studio. Make sure the SDK is installed on the machine before running the project. The plugin's TS/Libs folder holds only the managed assemblies (TsSDK.dll and TsApi.dll) that wrap the native teslasuit_api.dll.

2. Import the plugin package#

Import the plugin the same way as any Unity package:

  1. In the Unity Editor, open Assets > Import Package > Custom Package.
  2. Select the Teslasuit .unitypackage file.
  3. Keep all items selected and confirm the import.

After import you will see the TS/ folder in your project, organised into four top-level folders:

FolderContents
ExamplesReady-to-open example scenes for haptics, mocap, and more. Use these as working references.
LibsManaged assemblies (TsSDK.dll and TsApi.dll) that bridge Unity to the Teslasuit SDK.
ScriptsThe plugin components and ScriptableObjects you add to scenes and assets.
TsAssetsSample .ts_asset files (haptic animations, effects, touch sequences) authored in Teslasuit Studio.

Example scenes referenced throughout these pages live under TS/Examples/Scenes/, for instance Haptic/PlayingTouches.unity and Mocap/SuitMocap.unity.

The sample .ts_asset files under TS/TsAssets/ ship with the plugin and drive the example scenes. To add your own, export a .ts_asset from Teslasuit Studio and drop it into your project: the plugin's importer converts each file into a Unity asset you can reference from component fields. Authoring assets is covered in the Teslasuit Studio documentation.

3. How the native library loads#

When Unity starts, the plugin's bootstrap step locates and loads the native Teslasuit libraries before the first scene loads. This happens automatically through TsInitializer, so you do not call it yourself. Because the native libraries live outside the Unity project, the plugin loads them from the SDK installation path. If the SDK is missing, TsInitializer throws a DllNotFoundException indicating that Teslasuit Studio is not installed correctly. See Advanced development for how the bootstrap fits into the plugin lifecycle, and TsInitializer for the component reference.

Add a device component#

The fastest start is the wiring the plugin already ships. For a glove, drop in a ready-made hand_l or hand_r prefab and connect a glove to get a live, fully rigged tracked hand. For a suit, start from the Suit mocap example scene, which wires a character to the suit stream. Below, this guide builds a suit object from components to show the underlying pattern, which works for any device.

You build Teslasuit behaviour by adding components to a GameObject. The plugin's root object, TsManager, owns the native session; it is created automatically when a component needs it, so you only add one manually if you want it visible in the hierarchy (see Advanced development and TsManager).

Device access comes from a TsDeviceBehaviour. The suit is the primary device, so this guide uses TsSuitBehaviour: create an empty GameObject, add the component, and set its SuitIndex to the suit you want (for example, Suit0 for the first suit).

For a glove instead, add TsGloveBehaviour and set its GloveIndex and side (Left or Right). Both share the same connection API shown below; the suit adds a typed Suit accessor (ISuit), the glove a Glove accessor (IGlove).

A device is not guaranteed to be connected when your scene loads. Connect your suit in the Teslasuit Control Center and make sure it is active before entering play mode.

You usually do not handle the connection yourself: the subsystem components in the next step activate automatically once the suit connects. If you do need to react to connect and disconnect in your own script, see Advanced development for the connection lifecycle and its threading caveat.

Access a subsystem#

Subsystem components live on the same GameObject as the TsSuitBehaviour and require it. Add the ones you need:

Each subsystem component grabs its device interface when the suit connects and clears it on disconnect, so it becomes usable automatically once the suit is available.

Here is a component you can attach to the suit GameObject. It sources the haptic and PPG subsystems in Start; from there you drive them in Update or your own methods:

using TsSDK;
using UnityEngine;

// Attach to the suit GameObject. RequireComponent adds the subsystem
// components automatically if they are not already there.
[RequireComponent(typeof(TsSuitBehaviour))]
[RequireComponent(typeof(TsHapticPlayer))]
[RequireComponent(typeof(TsPpgProvider))]
public class SuitDemo : MonoBehaviour
{
    private TsHapticPlayer m_haptic;
    private TsPpgProvider m_ppg;

    private void Start()
    {
        m_haptic = GetComponent<TsHapticPlayer>();
        m_ppg = GetComponent<TsPpgProvider>();
    }

    private void Update()
    {
        // Use m_haptic to play touches and m_ppg to read heart rate here.
    }
}

The Examples section covers complete scripts for each subsystem, including playing touches and reading PPG data.

Next#

Once you have a device connected in a scene, here is a suggested reading flow through the rest of the documentation.

1. Run something end-to-end: Examples#

Open a shipped scene and see a complete workflow on real hardware:

2. Understand what you built: Main concepts#

The concept pages explain the component model and what each subsystem exposes:

3. Drop in ready-made pieces: Prefabs & assets#

4. Look things up: Reference#

The generated component reference, split into two layers:

Reference · Core (bootstrap, devices, assets, helpers): Core & bootstrap, Devices, Assets, Utilities.

Reference · Subsystems (one group per capability): Haptic, Motion capture, Biometry.