Leap Motion Unreal Plugin

The Leap Motion Unreal plugin provides an easy, blueprint-friendly way to add motion-controlled 3D hands to an Unreal game. The philosophy behind this plugin is that it is easier to interact with a 3D world using Unreal hand models, physics, and colliders than by interpreting the somewhat abstract tracking data straight from the Leap Motion API. This approach works especially well with virtual- and augmented-reality applications where it is much easier for the user to comprehend the positions of their model hands in a simulated 3D space. The approach can work well on standard applications too, but you must take more care to provide sufficient depth cueing because of the often visually ambiguous relation between 3D objects displayed on a 2D display.

System Requirements

  • Leap Motion 2.2+
  • Unreal Engine 4.9
  • Windows 7, Windows 8 (Mac and Linux not supported at this time)

Installation

The plugin is included with Unreal Engine 4.9. No installation is required.

In Unreal 4.7, the plugin is only available as part of the Unreal Engine Full Source distribution. To use the plugin in Unreal 4.7, you must download and build Unreal Engine 4.7. Note: The plugin has a bug in Unreal Engine 4.8 that causes hand jitter. We recommend either using Unreal Engine 4.9 or building the 4.7 branch.

Enable the plugin

To use the plugin in a project, it must first be enabled:

  1. Open the project in the Unreal Editor.

  2. Open the Unreal Plugins browser: Menu Edit > Plugins.

  3. Find the Leap Motion plugin under Input Devices.

  4. Check Enabled to activate the plugin.

  5. Close and re-open the project.

    ../images/unreal/PluginBrowserEngine.png

In addition, to see hands in a level, you must have the Leap Motion service software installed and a Leap Motion hardware device plugged in.

Note that before building a package for a project, you must add at least one C++ class to it – even if that class is unused and empty. Adding this class triggers the running of the necessary build steps.

Troubleshooting

If you do not see hands after adding the Leap Motion Controller Actor class or the controller component to a level and pressing play, check the following:

  • The hands are within the scene camera’s field of view, not obscured by another 3D object, and are large enough to be visible. The 3D hands appear above the location of the Leap Motion Controller Actor (in front of the Leap Motion Controller Actor in HMD mode).
  • Make sure that the Unreal Editor (or app if running outside the editor) has the OS input focus. (The Leap Motion Service only sends data to the active application.)
  • Check that the Leap Motion icon in the task bar is green. If it has gone dark, the service isn’t sending out data. In this case, double check that the Leap Motion hardware is plugged in and check that the service is running (Task Manager, Services tab, look for LeapService).
  • Open the Leap Motion Visualizer from the task bar icon menu. If you see hands in the Visualizer, the problem is most likely within the Unreal plugin or your own application. If there are no hands in the Visualizer, the problem is outside Unreal.
  • If you cannot find the Leap Motion Controller Actor in the Unreal class panel, double check that the plugin is enabled.
  • If you get an error stating that, “Plugin ‘LeapMotionController’ failed to load because module ‘LeapMotionController’ could not be found,” make sure that you have added a C++ class to the project (the class can be empty and unused). Otherwise, the necessary build steps are not run.

Leap Motion API features not supported in Blueprints:

  • Tool tracking
  • Gestures
  • Motion heuristics
  • Interaction Box
  • Frame history
  • Touch emulation
  • Background applications

Unofficial Community Plugin

This plugin does not attempt to make every feature of the Leap Motion API readily available. For a more hands-on approach, you may want to check out the independent, community-created Unreal plugin for Leap Motion, available here: https://github.com/getnamo/leap-ue4. You can also access the Leap Motion API directly using C++.