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 on GitHub in OptiTrack's optitrack-godot repository:
Click the green
code button at the top of the file list. Select Download ZIP to download the plugin locally.

Once downloaded, unzip the plugin to a local directory.
In Windows Explorer, open the extracted folder, optitrack-godot-main, 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.
For more information about streaming from Motive, please see the Data Streaming page.

Create Rigid Bodies
In Motive, create the Rigid Bodies that you wish to stream into Godot. Refer to the Rigid Body Tracking page for detailed instructions on how to create a Rigid Body in Motive.
Once you have Rigid Bodies 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.

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?

