OptiTrack Godot Plugin
A guide to installing and using the OptiTrack Godot plugin.
Overview
The OptiTrack Godot Plugin enables real-time streaming of Rigid Body data from Motive into Godot for visualization and recording.
Requirements
Godot version 4.6 or higher. Download the Godot software from the godotengine.org download page.
Motive version 3.4 or higher.
Godot Setup
Download the Plugin
The OptiTrack Godot plugin is available from the OptiTrack Plugins download page.
Once downloaded, unzip the plugin to a local directory.
In Windows Explorer, open the extracted folder, optitrack-godot-plugin_1.0.0, then open the example-project folder. Leave this folder open for a future step.
Import into the Godot Project
Open Godot, version 4.6 or higher.
The Project Manager window will open.

Click the
Create button in the upper left. Assign a Project Name and Browse to select the location to save the project.

Click the
Create button at the bottom of the screen to open the project.Return to the Windows Explorer window where the extracted folder optitrack-godot-main is open. Open the example-project folder and drag the addons folder into the FileSystem tab in Godot.
If your project already has a folder called addons, open the plugin's addons folder and copy the folder named optitrack_plugin into the project's existing addons folder.

You may see several error messages after the application finishes registering global classes, even though the plugin has installed successfully. Look for the optitrack_plugin in the addons folder in the Godot File System to verify that the installation completed.
Activate the Plugin in Godot
Now that the plugin is available in the project, it needs to be activated.
From the Project menu, go to Project Settings...

Open the Plugins tab.
Find the Optitrack plugin in the list and check the box to Enable it.
Click Close to return to the project.

The OptiTrack tab will now be available in the left-most pane, along with the File System and History tabs. You may need to expand the width of the pane to see all three.
Once the plugin is enabled, restart Godot.

Motive Setup
Enable Streaming
In Motive, click the
Streaming Settings button in the bottom right corner of the Control Deck.
To stream to Godot, make sure Streaming is enabled in the NatNet settings and the Transmission Type is set to Multicast.
To stream skeletons, set the Skeleton Coordinates to Local and the Bone Naming Convention to FBX. The skeleton should also be set with a Y-up axis.
For more information about streaming from Motive, please see the Data Streaming page.

Create Assets in Motive
In Motive, create the Skeletons and Rigid Bodies that you wish to stream into Godot. Refer to the Skeleton Tracking page and the Rigid Body Tracking page for detailed instructions on how to create a Skeleton or Rigid Body in Motive.
Once you have assets to track in Motive, you're ready to stream them into Godot.
Godot Plugin Connection Setup
Now that Motive is streaming, you're ready to configure the object connection in Godot.
Create an OptiTrack Rigid Body Node
In the Scene pane, in the Create Root Node options, click 3D Scene.

The Scene pane will change to show Node3D. The Inspector tab will display on the right.
Right click Node3D to access the context menu, then select Add Child Node...

The Create New Node window will open.
Type Optitrack in the search bar and press enter.
The search results will return OptiTrackRigidBody.
Select OptiTrackRigidBody then click the Create button at the bottom.

The child node will appear in the Scene pane. To see the list of rigid body assets from Motive in the OptiTrack pane, click the Start Connection button.


Add a Mesh
Apply a mesh to visualize the rigid body in the scene.
In the Scene tab, right click OptiTrackRigidBody and select Create Child Node.
Search for MeshInstance3D. When found, select it and click Create.

The MeshInstance3D properties will display in the Inspector Window.
Click the dropdown menu in the Mesh field to select a mesh. For testing, we recommend selecting a primitive mesh, such as a box or a sphere.
Once the mesh is applied, a graphical representation will display in the Inspector tab as well as in the 3D scene.




Add Animation
With the MeshInstance3D installed, select the OptiTrackRigidBody node in the Scene hierarchy.
In the Inspector panel, check the box to Animate in Editor.

Use the buttons at the bottom of the OptiTrack pane to play or pause the selected take in Motive.

Configure Skeletons
The OptiTrack Godot plugin includes compiled skeleton assets in both gendered avatars (female and male) for each spine model (the classic 3-segment spine or the default 7-segment spine), for a total of four skeleton options:
OptiTrackAvatarFemale3.tscn
OptiTrackAvatarFemale7.tscn
OptiTrackAvatarMale3.tscn
OptiTrackAvatarMale7.tscn
These assets are located in the addons folder under optitrack_plugin > model scenes.
Before adding a skeleton to the scene, you will need to assign the mesh if using Godot 4.6 or higher. Note that these steps are not required if using Godot 4.5.
double-click the .tscn file in the Godot File System. This will open the model in a new window in the 3D viewport.

In the Scene panel, select the Mesh. This will display the mesh properties in the Inspector panel.
In the MeshInstance3D section, click the Assign button for the Skeleton property.

Select the mesh from the list then click OK.

The skeleton and avatar will now align in the 3D view:

Close the tab for the .tscn file by clicking the x in the tab corner.
Godot will prompt to save the scene. Click OK and ignore any errors that display.
Repeat these steps for each avatar type that you plan to use in your scene.
Create an OptiTrack Skeleton Node
To add a child node for a skeleton to the project:
Open the addons folder and browse to optitrack_plugin > model scenes
Click and drag the .tscn file that corresponds to the asset in Motive into the scene, directly below Node3D.

Select the skeleton to display its properties in the Inspector tab.
Click the Skeleton Asset ID dropdown to select the skeleton asset from Motive.
Make sure the Animate in Editor option is on.

Click the Refresh Asset List button if the list of assets in the dropdown differs from the loaded Take in Motive.

The skeleton should now animate properly in Godot.

Troubleshooting
If the object does not animate:
Restart Godot.
Reopen the project.
Click Start Connection again.
In most cases, the data stream will reconnect successfully after restarting.
Last updated
Was this helpful?

