---
title: "Use the plugin with Unity"
canonical: "https://help.vicon.com/space/UnityPlugin13/14450899/Use%20the%20plugin%20with%20Unity"
format: markdown
---
> Macro (scroll-ignore)
> 
> ![image](media://87b541e6-b59b-4485-ac4c-8e06e451befc)

This section describes how to use the Vicon VR for Unity plugin to stream data between Vicon software and Unity.

> ℹ️ **Set up your software before using the plugin** 
> ℹ️ 
> ℹ️ See the following documentation for more information on setting up:
> ℹ️ 
> ℹ️ - To set up Unity, see [Set up Unity with the Vicon plugin](https://vicon-help.atlassian.net/wiki/spaces/UnityPlugin13/pages/14451155).
> ℹ️ - To set up your Vicon software, see [Set up Vicon software to capture mocap data for use with Unity](https://vicon-help.atlassian.net/wiki/spaces/UnityPlugin13/pages/14451347).


    > Macro (anchor)




## Stream data from a full body and retarget to a mesh in Unity

Use the plugin to stream movement data from a performer in a mocap suit to a humanoid character mesh in Unity.

Some applications of this functionality include:

- Creating realistic, complex animations for in-game characters, eg walking and dancing.
- Quickly prototyping level design and character movement in the context of your project.
- Live streaming data from players in a Virtual Reality (VR) environment to display in-game, eg in social VR environments.

![image](media://d80a37a7-7e00-4b34-9e74-dfa776fa0cc8)


    To stream data from a full body to Unity:


1. Add a character mesh to the scene with the same skeleton as the Vicon solve or retarget .
  This can be your own custom mesh, or one of the examples provided in **Assets** > **ViconUnityPlugin **> **ViconSkins**.
2. In the Inspector, add a **Subject Script** component to the GameObject.
3. Set the **Subject Name** field to the same name as the subject in the Vicon application.
4. To set the **Client**, click and drag the ViconDataStreamClient prefab from the current scene into the entry field.
5. Select the **Play icon** in Unity to see the plugin apply mocap animation data to the mesh.

To stream multiple subjects from the Vicon application to different meshes in Unity, duplicate the character GameObject and update the attached mesh and **Subject Name** as needed.

If you are having issues streaming full-body data to Unity, see [Troubleshooting common issues](https://vicon-help.atlassian.net/wiki/spaces/UnityPlugin13/pages/14450792) or contact [Vicon Support](mailto:support@vicon.com).

## Stream data from a prop to a mesh in Unity

Use the plugin to stream movement data from a physical prop with mocap markers to a prop mesh in Unity.

Some applications include:

- Creating realistic character animations featuring props in Unity, eg sword fighting moves.
- Tracking physical props used by the player in Virtual Reality (VR) environments to translate the movement to their virtual counterparts, eg weapons and flashlights.

![image](media://e75540f6-8e73-418f-b549-2ee2dacef3a5)

To stream data from a prop to Unity:

1. Add a prop mesh to the scene. This can be your own custom mesh, or one of the examples provided in **Assets **> **ViconUnityPlugin** > **PropMeshes**.
2. If an actor is interacting with the prop, set the prop as a child object of the actor.
  1. To set the prop as a child, go to the **Inspector** and drag and drop the prop GameObject onto the actor GameObject.
  2. In the Transform component of the prop, set all of the values to 0. It inherits new transform data from the actor to keep their position and rotation data in sync.
3. In the Inspector, add the relevant plugin component to the GameObject:
  1. For single-segment skeletal props (recommended): add the SubjectScript component.
  2. For non-skeletal props: add the RBScript component.
4. Set the **Subject Name**/**O****bject Name** field to the same name as the object in the Vicon application.
5. To set the **Client**, click and drag the ViconDataStreamClient prefab from the current scene into the entry field.
6. Select the **Play icon** in Unity to see the mocap animation data being applied to the mesh.

If you are having issues streaming prop data to Unity, see [Troubleshooting common issues](https://vicon-help.atlassian.net/wiki/spaces/UnityPlugin13/pages/14450792) or contact [Vicon Support](mailto:support@vicon.com).


    > Macro (anchor)




## Use a head-mounted display (HMD)

Use the plugin to stream location data from an HMD to Unity, and visual data from Unity to the HMD.

Some applications include:

- Tracking player location in Virtual Reality (VR) environments to allow them to move through the in-game world.
- Syncing the visual feed in the display with the Unity camera and motion capture data, so players can move their head and look around the in-game world.

1. Add an **HMDPrefab** to the scene from **Assets** > **ViconUnityPlugin** > **Prefabs**.
2. Open the **PoseProvider** child of the prefab in the **Inspector**.
3. Go to the **HMD Script** component of the PoseProvider in the **Inspector**.
4. Set the **HMD** field to the same name as the HMD object in the Vicon application.
5. To set the **Client**, click and drag the ViconDataStreamClient prefab from the current scene into the entry field.
6. Select the  **Play icon**  in Unity and put on your HMD to see the game world update as you look and move around the space.

If you are having issues using a head-mounted display (HMD) with Unity, see [Troubleshooting common issues](https://vicon-help.atlassian.net/wiki/spaces/UnityPlugin13/pages/14450792) or contact [Vicon Support](mailto:support@vicon.com).


    > Macro (excerpt-include)