- Unity Plugin 1.0.0b
To install Smartsuit plugin for Unity, in your project, select Assets → Import Package → Custom Package, locate the Smartsuit plugin and click open.
In the Import Unity Package window that will open, click Import
You should now see the following folder structure in your project files.
With the plugin there are 3 scenes that demonstrate how you can use the plugin with your character. The scenes are located in Rokoko/Smartsuit/Examples.
Basic example of how you can animate a character using SmartsuitPro.
Basic example of how you can view the status of the Smartsuit, and send commands to it.
Basic example of how you can animate multiple characters using one or more SmartsuitPro suits. It also demonstrates how you can view the status of the Smartsuit, send commands and change the character which is controlled by the Smartsuit.
This prefab is located in Rokoko/Smartsuit/SmartsuitReceiver. It can be used to setup the network interface between Smartsuit Pro and unity. It is preconfigured to accept any Smartsuit and to use the default port 14041.
This prefab is located in Rokoko/Smartsuit/SmartsuitActor. It is the basic character that comes with the plugin and is setup to use any Smartsuit Pro that will be connected.
This prefab is located in Rokoko/Smartsuit/Prefabs/SmartsuitControls. This prefab implements a basic UI that can be used to control the Smartsuit. To use this prefab, first create a UI Canvas and drag the prefab inside this canvas. Then you have to assign a SmartsuitActor that you want to control.
This prefab is located in Rokoko/Smartsuit/Prefabs/SmartsuitStatus. This prefab shows the status of the Smartsuit, including FPS information, the name of the smartsuit, etc. To use this prefab, first create a UI canvas and drag the prefab inside the canvas. Then you have to assign a SmartsuitActor that you want to see the status.
This prefab is located in Rokoko/Smartsuit/Prefabs/SmartsuitSelector. This implements a simple UI that allows you to change the character a Smartsuit Pro controls. To use this prefab, first create a UI canvas and drag the prefab inside the canvas. Then you have to assign the Smartsuit actor for which you want to select a Smartsuit.
Putting all the prefabs together your scene will look like this.
Here you can see the main components and a description of how you can use them.
Smartsuit Receiver component implements the network communication between the Smartsuit Pro and Unity. You should always have one Smartsuit Receiver component running in the scene in order to use the Smartsuit Pro.
- Auto Start: The Suit Receiver socket that listens for Smartsuit Pro's will start automatically
- Port: The port number at which the socket will listen for Smartsuit Pro's
- Listen Suit: Setting this false will make Suit Receiver ignore the incoming data from any Smartsuit Pro's
Smartsuit Actor apply the position and rotation data received from a specific Smartsuit Pro to the character that is attached to. It also provides methods to send commands to the Smartsuit Pro and receive information related to this Smartsuit.
- Auto Select: If checked the actor will be controlled with the first Smartsuit Pro which will appear online. If unchecked the actor will be controlled by the Smartuist Pro with the Hub ID specified.
- Hub ID: The Smartsuit Pro Hub ID that will control this Smartsuit Actor. If Auto Select is checked the Hub ID will be mapped to the first online suit that will appear.
- Use Humanoid Bones: If checked the actor will use the Humanoid avatar assigned to the same game object and we don't have to map the character bones manually.
- Bone Mapping: When we don't use Humanoid Bones, we have to specify the corresponding bones manually.
Scale avatar should be used when you want to scale your character to fit the body model of the player who is in the Smartsuit Pro. This will scale the character bones so they match the bone lengths defined in the body model. This may cause skinning issues if the characters are not properly setup for this behavior.
Setup a scene from scratch
In this section we will see how we can setup a scene with a character from scratch.
Drag SmartsuitReceiver prefab (Rokoko/Smartsuit/SmartsuitReceiver) inside your scene hierarchy. Make sure the Port number is 14041 (or if you changed the port number in the Smartsuit, that it is the same with the number you set). Make sure Auto Start and Listen Suit are checked.
Drag your 3D character inside your scene hierarchy. In this example we will use RokokoGuy which is the character packaged with the plugin. Your character needs to be in T-pose for the plugin to work properly.
Add a SmartsuitActor component to your character. This component will animate your character based on the data received from the Smartsuit Pro. If your character's rig is setup as humanoid, then you can leave Use Humanoid Bones checked and the SmartsuitActor will use the Animator component to find the bones it will animate. If your character is not humanoid, you have to uncheck Use Humanoid Bones, and then define the bone Transforms manually.
Optionally, you can add a ScaleAvatar component to your character. This component will scale your character based on the body dimensions used by the Smartsuit Pro. This can make your character walk more realistically according to the Smartsuit Pro, but it can cause skinning issues to your character, in which case you can ignore this component.
If you now click the play button, and you have your Smartsuit Pro on, the character will use your Smartsuit Pro data to animate.
Optionally, if you want to be able to send commands to Smartsuit Pro, drag the SmartsuitControls prefab (Rokoko/Smartsuit/Prefabs/SmartsuitControls) into a canvas in your scene hierarchy. Once you do that In the SmartsuitControls component of the prefab, assign the Smartsuit reference you want to send commands to. The referene should be the SmartsuitActor component of your character in the scene.
This prefab will give you the following options:
- Restart: This will reset the Smartsuit Pro sensors
- Calibrate: This will perform an A-pose calibration on the Smartsuit Pro
- Broadcast: This will set the Smartsuit Pro in Broadcast mode
- Unicast: This will set the Smartsuit Pro in Unicast mode
- Set body model: This will apply the defined body model in the Smartsuit Pro. This body model is located in the SmartsuitControls component of the prefab
- Set position: This will move the Smartsuit Pro into a position defined by the Target Transform parameter of the SmartsuitControls.