1. StretchSense Knowledge Base
  2. Streaming to Other Software

Streaming from Hand Engine to Unity (DOC-5011)

This document will take you through the steps of linking Unity with a Hand Engine data stream and visualizing this in Unity.

Requirements

Setting Up your Unity Project

  1. Download and Install the StretchSense Hand Engine and Unity

    NOTE: In this guide, we are using the Unity version 2019.4.17f1

  2. Launch Hand Engine and set up a hand

    See Hand Engine User Guide (DOC-5010) for glove calibration instructions

  3. Launch Unity Hub and create a new project

     

  4. Select the 3D option from the templates window, then click Create

     

     

  5. Once your project is created we will bring in the Hand Engine Plugin by right-clicking in the Project Assets Directory and selecting > Import Package > CustomPackage

     

     

  6. Select the HandEngineUnity_01.00.01.unitypackage

    NOTE: The most up-to-date Unity package can be found in the Plugins folder you downloaded from your http://www.stretchsense.com/my-account   (see image below).

     

     

  7. When prompted import all of the elements in the package

    NOTE: this will replace the default SampleScene

     

  8. Under Assets, open the Scenes folder

     

  9. Double click on HandEngine Example

     

  10. Once the scene is reloaded your view should show the hands in Scene/Game Views and a Hand Asset in the Hierarchy

     

  11. Our Hand Engine and Unity project are now set up and the next step is to link them together. Return to the Hand Engine window and in the Streaming box on the left of the screen, enter your TCP Port number, and set the switch to On. Check that the Streaming Status light in the Performer pane title bar (the right traffic light indicator) has turned green.

     

     

  12. Move back to your Unity project and start your scene by pressing the Play icon

     

  13. Click on each of the Hand_L or _R Assets in the Hierarchy view, this will bring up options in the Inspector view.

     

  14. Go over to the Inspector view and check the Host and Port settings match what you set in Hand Engine in Step 11 above. You will have to check this for both hands.

    NOTE: The default value for Host is 127.0.0.1 = localhost, i.e. you are running Hand Engine on the same PC that you are running Unity. If you have bound Hand Engine to a different IP address (e.g. if you are running Hand Engine and Unity on different computers on the same LAN), use this IP address instead for Host.

     

     

  15. Press the Connect check box once to make the hand asset in Unity live and slaved to the data stream coming from Hand Engine, and the connected hand will start moving.

    NOTE: This check box will clear itself immediately and the connected hand will start moving.

     

     

  16. You can now use the hand controlled by your StretchSense MoCap Pro Glove in your Unity Project.

Disclaimer, Intellectual Property, and Licensing

Revision Summary

Revision

Date

Notes

11

2021.11.01

Updated links for HS

10

2021.10.04

Updated images for HE 1.4

9

2021.07.27

Updated images.

8

2021.04.09

Updated for Unity 2019.4.17f1, updated screenshots, and steps for the data stream.

7

2021.03.24

Updated for Hand Engine 1.1.0

6

2020.10.02

Updated for Hand Engine 1.0.1

5

2020.10.02

Updated for Beta4

4

2020.09.21

Updated for Beta3.5

3

2020.08.21

Updated for Beta3

2

2020.07.21

Updated related docs, added disclaimer text

1

2020.07.09

Initial version