Unreal 4.7 Demo Pack

VR   11.4K     
Add Leap Motion support to Unreal Engine 4 titles!
Download Executable Available for Windows.

The Leap Motion Unreal plugin provides a fast and easy way to add virtual hands to your games and includes HMD tracking mode and support for API features like grab strength, pinch strength, bone attributes, and left vs. right.

Let us know what features you’d like to see next on our official forum thread or on the Unreal forums.

You can get the Unreal 4.7 Source + Leap Motion Plugin here.

Click here to download the Demo Pack.

Unreal 4.7 Demo Pack

Note: to interact with the demos, your physical Leap Motion Controller must be connected to your computer. Run the demos and wave your hands above the device.
All examples require the Leap Motion UE4 plugin.

LeapCharacterExample Project:
This project uses the blueprint-only first-person perspective template. The Character blueprint has been modified to attach LeapMotionControllerComponent. Also, a custom LM_NoCollideBoneActor is created and assigned as a property to the LeapMotionControllerComponent. This prevents unwanted collisions with the character's collision shape.

LeapCodeExample Project:
Requires: Microsoft Visual Studio 2012 (used as a dependency)

This project shows how to use and link to the Leap Motion plugin from C++ code. It introduces a single class, LeapMotionDebugInfo, which uses both the plugin code, and also accesses LeapSDK directly. The class displays hand info on the screen. This requires adding both the plugin and LeapSDK modules as dependencies in LeapCodeExample.Build.cs.

LeapExamples Project:
This is a blueprint-only project that requires no code, and contains four demo levels. Open each by opening the Game|Maps folder in the Content Browser and double-clicking the map asset.

Collisions Demo:
This is a basic scene that shows collision interaction of the Leap Motion-controlled hands within a physical scene by a simple drag-and-drop of a LeapMotionControllerActor from a class list. The default settings create a simple physical model, as well as a crude visual hand representation. The visual cubes are StaticMeshActors with physics simulation enabled.

Custom Controller Demo:
This demo shows basic customization of the behavior of the LeapMotionControllerActor. It uses LM_DemoControllerActor and LM_DemoBoneActor, which are located in the Games|Demo folder. Those blueprints derive from the corresponding C++ classes defined in the Leap Motion Controller plugin.

LM_DemoControllerActor overrides OnHandAdded/Removed events and uses them to print out simple info about the hand's ID. LM_DemoBoneActor overrides its tick event to periodically output its index finger's position. The LM_DemoBoneActor is then attached to the controller actor in the controller's settings pane, via the Bone Blueprint property.

Multiple ControllerActor Demo:
This is a very simple demo showing the use of multiple LeapMotionControllerActor objects to create multiple instances of hands.

Rigged Hands Demo:
This demo uses the rigged hand assets located in the Game|Rigged folder. LM_RiggedHandActor derives from the LeapMotionHandActor C++ class from the Leap Motion plugin. It simply contains a PoseableMeshComponent with the hand model, and implements the tick event to drive it using the positions of the physical bones.

The actor contains a helper SceneComponent to help align the mesh's elbow position at the object's origin. In the tick, the script places the PoseableMeshComponent at the location of the elbow of the hand, and then only drives each of the bone's global rotations. To hide the physical bone visualization, disable the LeapMotionControllerActor's Show Collider and Show Mesh properties.


To package and build executables for any of the demo projects, the projects must be converted to a C++ project. (The LeapCodeExample already is a C++ project, so nothing extra needs to be done for this project.) For the other projects do the following:

  1. In the Unreal Editor, select the File | Add Code to Project... menu command.
  2. In the Add Code dialog, use the default options and click 'Next >' and then click 'Create Class'.
  3. Unreal Editor will add a Visual Studio project and source directory to your Unreal project folder.

This should open Visual Studio and load the code project. If it doesn't select the File | Open Visual Studio menu command.

  1. In Visual Studio, open the Solution Explorer and edit the file "Games\YourProjectName\Source\YourProjectName\YourProjectName.Build.cs".
  2. Add "LeapMotionController" and "Leap" to the PublicDependencyModuleNames list. The statement should look like this when you are done:

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" , "LeapMotionController" , "Leap" });

  1. Build the solution (press Ctrl+Shift+B).

After you have followed these steps once for a project, you can package and build normally from the Unreal Editor File > Package Project menu.