Unreal Editor for Fortnite (UEFN): OptiTrack Plugin for Live Link Hub

Use the Live Link Hub to stream OptiTrack camera data to the UEFN plugin for video game development in Fortnite.

Overview

The OptiTrack Live Link Hub plugin allows game designers to use OptiTrack Motion Capture data to animate characters in Fortnite through Unreal Editor for Fortnite (UEFN).

Requirements

Download the latest Unreal Engine 5 Plugin from the OptiTrack Downloads page.

Open the Epic Games Launcher. The following Epic Games applications must be installed:

  • Unreal Engine 5.5

  • Live Link Hub

  • UEFN

  • Fortnite

Getting Started

Install the Plugin

  • Launch Unreal Editor for Fortnite (UEFN).

  • Select Live Link Hub from the Tools menu, if it's not already open.

  • Click the Settings button in the upper right corner and select Plugins...

  • In the User Plugin Directories section, click the Add Element button.

  • Click the ellipses button to browse to and select the downloaded plugin.

  • Restart UEFN when prompted after the plugin is installed.

Motive Streaming Settings

  • In the NatNet section, select Enable to begin streaming.

  • Select the Local Interface. Use Loopback if streaming to the same computer, otherwise select the IP address for the network where the client application resides.

  • Set the Bone Naming Convention to UnrealEngine.

  • Set the Up Axis to Y-Axis. The plugin will bring the data in with a Y-Forward orientation.

Please see the Data Streaming page for more details on all settings available for streaming.

Add Source

  • In Unreal Engine, open Live Link Hub from the Tools menu on the toolbar, if it's not open already. Under Virtual Production, select Live Link Hub.

  • Select OptiTrack Source, check Connect Automatically, or enter the IP address for the Motive PC in the Server Address field, the IP address for the Unreal PC in the Client Address field. Enter 127.0.0.1 in both fields if running both on the same PC. Click create.

Properties are shown in the Source Details tab when the OptiTrack source is selected. The properties that are applicable to Fortnite characters are listed below.

Streaming Data Offset

Adjust the location, orientation, or scale of the streaming data.

Timecode

Timecode is fully supported in the plugin. Click the button in the top right to use preset system time codes or add a new Timecode Provider in the Source Details tab.

Timecode data may appear to stutter in Unreal Editor even when it is transmitting correctly. To confirm that the data is in sync, compare the timecode in Live Link Hub to the timecode in Motive.

Copy Assets to Project Folder

We recommend using Windows Explorer to copy assets into the project folder. Right-click the project folder in the Unreal Editor Content Browser and select Show in Explorer.

In the Content Browser, copy the following files and folders from All > Engine > Plugins > OptiTrack - Live Link Content > Animations to the project folder:

  • Female Avatar (folder)

  • Male Avatar (folder)

  • Textures (folder)

  • IK_MotiveAvatar_Opti.uasset (file)

  • SK_MotiveAvatar_Opti.uasset (file)

Unreal Editor will validate the project files before launching the live session.

Create Retargeter in Unreal Editor

All skeletons in Unreal Editor are based on the standard Fortnite mannequin. Animation is applied to the mannequin rather than using an animation blueprint. In this example, we will use the Fortnite Mannequin to build an IK Rig to receive data from the OptiTrack skeletons.

Create IK Rig

Before creating our IK Rig, drag the Motive Avatar of your choosing into the scene to prep the retarget phase.

To create the IK Rig:

  • Right-click in the Content area. Select Animation > Retargeting > IKRig.

  • Name the IKRig. We recommend IK_FNMannequin.

Double-click the newly created IKRig to edit it. This will open in a new window.

In the Details tab, change the Preview Mesh to the FN Mannequin.

The mannequin is pre-configured to work with Fortnite. This allows you to use the Auto Create features in the upper left corner to finish setting up the IK Rig.

  1. Click the Auto Create Retarget Chains button.

  2. Click Auto Create IK.

  3. Click Reset.

  4. Click Save.

The IK Rig is now configured and the tab can be closed.

Create IK Retargeter

  • Right-click in the Content area. Select Animation > Retargeting > IK Retargeter.

  • Name the IK Retargeter. We recommend RTG_Motive_FN.

  • Open the newly created Retargeter.

  • On the Details tab, go to Source > Source IKRig Asset.

  • Use the dropdown list to select the standard Motive avatar, IK_MotiveAvatar_Opti.

Align Skeletons

The Viewport will show that the two skeletons are not properly aligned. This occurs because the skeletons are in different poses.

  • Click the Running Retargeter button in the upper left corner to stop the retargeter and switch to edit mode. The button will update to Editing Retarget Pose.

  • Set the Retargeter back to Run mode for the remaining steps.

Blend to Source

To complete the next step, it's easiest if only the mapped bone chains are visible.

  • In the Chain Mapping pane, click the Settings button and select Hide Chains Without IK.

  • Select all of the mapped Chains.

  • In the Details tab, go to IK > Blend to Source.

  • Set the value to 1.0.

  • Go to Blend to Source > Blend to Source and set the value to 1.0.

The retarget will now display correctly in the Viewport. This window can now be closed.

Add Animation

  • From the Content Browser, drag the skeletal mesh for the Fortnite mannequin into the scene. The mannequin is located in All > Fortnite > Characters > PlayerBasics.

  • Both the Motive Avatar and the Fortnite Mannequin will be in the scene.

  • Select the Motive Avatar.

  • In the Details tab, go to Performer > Performance Capture > Subject Name.

  • Select a performer from the list of actors in Motive.

  • The Motive Avatar will now animate with the selected actor.

  • Select the Fortnite Mannequin to display its properties in the Details pane.

  • Once the Retarget Component is attached to the Mannequin, update the following properties in the Retarget section:

    • Source Skeletal Mesh Component: Select the Motive Avatar.

    • Controlled Skeletal Mesh Component: This should already be set to the Fortnite Mannequin.

    • Retarget Asset: Select the IK Retargeter created in an earlier step (RTG_Motive_FN in our example).

Align the Avatar and Mannequin

  • In the Outliner pane, drag the Mannequin to nest under the Motive Avatar.

  • In the Details pane for the Mannequin, go to Transform > Location and reset the values to 0.

  • The Avatar and the Mannequin will be aligned.

Record Animation

Once all of the characters are configured, the next step is to record the animation using the Take Recorder and Sequencer in Unreal Editor.

  • To open either pane, go to the Windows menu > Cinematics.

  • Type the project name in the Slate field.

  • Select From Actor > Add 'Device Mannequin'.

With the Mannequin selected, update the following properties:

  • Disable Transform > Transform Track.

  • Disable Animation Recorder > Remove Root Animation (shown below).

Countdown

Go to User Settings > Countdown to include a countdown timer to start recording.

Recording

To begin recording, click the large red Play button on the right edge of the Slate in the Take Recorder:

Review Recording

When the recording is completed, click the Review button in the Take Recorder pane.

The character will now animate as expected.

You can find the Take and the associated animations in the Cinematics folder in the Content Browser. Takes are organized with a folder for each subscene. The animations recorded in that subscene are stored in an Animation folder, one for the Device Mannequin and one for the Motive Avatar.

Animate Fortnite Characters

Now that the animation has been created and aligned to the Device Mannequin, it's time to apply it to a Fortnite character. Since all characters in Fortnite use this same skeleton, no additional alignment is required.

Select a Character in UEFN

Fortnite has a large selection of characters available, all based on the Device Mannequin skeleton. To add a character to the scene from the Content Browser:

  • Go to Fortnite > Devices > AI.

  • Drag the Character Device to the scene.

  • Select the Character Device in the Viewport.

  • Go to Fortnite > Characters and select the desired character from the gallery.

  • In the Details pane for the newly added Character Device, drag the Fortnite character you wish to use to User Options > Character.

Apply Animation

  • Select the Fortnite character in the Viewport.

  • Under User Options, check the box for Custom Idle.

  • Drag the Device Mannequin animation from the Content Browser to the Custom Idle field.

  • Fortnite will update the game in Edit Mode, with the status displayed in the upper right corner. The game will move through the following phases: Preparing; Loading Project; Downloading; and Connecting (displayed on the Edit Session screen). When the game loads, the status will be Up to Date.

  • The animation will play on the Fortnite character when the game starts. It will not play in the editor. To see this, you can start the game from UEFN or inside Fortnite itself.

Last updated

Was this helpful?