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 Setup

Download the Plugin

The OptiTrack Godot plugin is available on GitHub in OptiTrack's optitrack-godot repository:

  • Click the green A screenshot of the <> Code button in Github. code button at the top of the file list.

  • Select Download ZIP to download the plugin locally.

A screenshot of the OptiTrack\optitrack-godot repository in GitHub, with the code button activated to show the menu options. Download ZIP is at the bottom of the list.
  • 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.

A screenshot of the Godot Project Manager screen, with no projects in the list.
  • Click the A screenshot of the Create button on the Godot Project Manager screen. Create button in the upper left.

  • Assign a Project Name and Browse to select the location to save the project.

A screenshot of the Godot Create Project screen.
  • Click the A screenshot of the Create button that saves the Godot project. 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.

circle-info

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.

A screenshot of the Godot application just after dragging the OptiTrack Godot plugin addins folder into the Godot fileshare tab.
circle-info

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...

A screenshot of a project in Godot, with the Project menu open.
  • 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.

A screenshot of the Godot Project Settings, Plugins tab, with the Optitrack plugin enabled.

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.

A screenshot of the Optitrack pane in Godot.

Motive Setup

Enable Streaming

In Motive, click the A screenshot of the Streaming Settings button from the Motive Control Deck. 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.

A screenshot of the Motive Streaming Settings, with the "Enable" setting turned on and the "Transmission Type" setting set to Multicast. Both settings are highlighted.

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.

A screenshot of the Scene pane in Godot, with the options to Create Root Node: shown.

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...

A screenshot of the Godot project screen, with the context menu for the Node3D options displayed.

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.

A screenshot of the "Add Child Node" screen, with OptiTrack in the search criteria and OptiTrackRigidBody as the sole search results.

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.

A screenshot of the Godot Scene and OptiTrack panes, with the OptiTrackRigidBody child node added and the Streaming Connection stopped.
A screenshot of the Godot Scene and OptiTrack panes, with the OptiTrackRigidBody child node added and the Streaming Connection enabled.

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.

A screenshot of the Godot "Add Child Node" search results,with MeshInstance3d selected.
  • 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.

A screenshot of the Godot Inspector tab, showing the properties for the MeshInstance3D child node. No mesh has been applied yet.
Before a Mesh is added.
A screenshot of the Godot Inspector tab, showing the properties for the MeshInstance3D child node. The dropdown menu to apply a mesh is open.
Adding the Mesh.
A screenshot of the Godot Inspector tab, showing the properties for the MeshInstance3D child node. A Box Mesh is now applied.
Mesh is now applied.
A screenshot of the Godot 3D perspective window, with a box mesh applied to the rigid body asset..
Mesh shown 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.

A screenshot of the top portion of the Godot Inspector tab, for the OptiTrack plugin.
  • Use the buttons at the bottom of the OptiTrack pane to play or pause the selected take in Motive.

A screenshot of the Motive Timeline Play and Motive Timeline Pause buttons from the OptiTrack plugin 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?