The Unity game engine includes built-in support for VR development. To start building with Leap Motion Orion, make sure you have Unity 5.3 installed. Setup instructions and older asset versions can be found below. To upgrade your older project to Orion, check out our upgrade guide.
Unlock new possibilities in your Orion project with Modules – powerful extensions built on top of our Unity Core Assets. These modules are dependent on the latest version of the Core Assets. Learn more about our new workflow and roadmap for Modules on the blog. For older Module releases, see our Archived Assets.
Unity Core Assets Release Notes (4.1.4)
- Handpool will no longer error if there is an empty model slot in the HandPool
- Models spawned by with Handpool's CanDuplicate are now parented to a ModelsParent transform specified in the HandPool's inspector. If this is left empty, then spawned model's are not parented.
- Minor modifications to support Interaction Engine
- Refactored PinchDetector so that it has an abstract base class. This paves the way for future, similar detectors.
- Added standard Color definitions for Detector gizmo drawing
- Added Minimum and Maximum extended finger counts to ExtendedFingerDetector. This allows you to specify that at least a minimum and/or no more than a maximum number of fingers are extended.
- Streamlined ExtendedFingerDetector code.
- Changed FingerDirectionDetector to use the direction of the distal phalanges rather than the intermediate phalange.
- Added Tag name setting to ProximityDetector that adds any objects with the specified tag to the target object list.
- Added a Layer option to ProximityDetector, which uses the specified Layer for proximity checks rather than the target object list.
- Runtime Gizmos!
Older versions of our Orion Assets and Modules can be found below. Be sure to use the recommended Unity and SDK versions:
Quick Setup Guide
Setting Up the Core Assets
- Ensure that you have the Leap Motion Orion software and the Oculus 1.3 runtime (if applicable) installed.
- Download the Unity Core Assets (see above).
- In Unity, go to File and click New Project…
- Name your project and click Create Project.
- Right-click in the Assets window, go to Import Package and click Custom Package…
- Find the Core Unity package and import it.
- From there, you’ll see three folders in the Assets window – the Plugins folder and LeapC folder which contain all of our API bindings, and the LeapMotion folder, which contain all of our Prefabs, Scripts, and Scenes.
- In the LeapMotion/Scenes folder the Leap_Hands_Demo scene provides a basic example of Leap Motion hands in a Unity scene.
- In the LeapMotion/Scenes folder the Leap_Hands_Demo_VR scene provides a basic example of Leap Motion hands in a VR Unity scene with Leap Motion video passthrough. Be sure to enable VR support in Edit/Project Settings/PlayerSettings/OtherSettings/Virtual Reality Supported. Video passthrough can be toggled by enabling or disabling the QuadBackground GameObject’s transform in the Inspector.
The instructions below explain how to recreate these scenes from scratch. But you can use these existing scenes as starting points for creating new experiences.
Setting up a Basic Leap Motion VR Scene
- Follow our VR Setup.
- Once you’ve set up the Core Assets (see above), go to LeapMotion/Prefabs in the Asset window.
- From LeapMotion/Prefabs, drag a LMHeadMountedRig into your scene.
- In the hierachy for the LMHeadMountedRig, you see a LeapHandController.
- From the LeapMotion/Prefabs/HandModelsNonhuman folder, drag a CapsuleHand_L and a CapsuleHand_R to your scene hierarchy window and make them children of the LeapHandController.
- From the LeapMotion/Prefabs/HandModelsPhysical folder, drag a RigidRoundHand_L and a RigidRoundHand_R to your scene hierarchy window and make them children of the LeapHandController.
- Locate the HandPool component attached to the LeapHandController. Set the Model Collection value to 4. Then move your two graphics hands and two physics hands from the Hierarchy view to the four empty slots.
- On the LeapHandController GameObject you’ll see a LeapProvider component. For VR, make sure that “Is Head Mounted” is enabled.
- Be sure to enable VR support in Edit/Project Settings/PlayerSettings/OtherSettings/ Virtual Reality Supported.
- Video passthrough can be toggled by enabling or disabling the QuadBackground GameObject’s transform in the Inspector.
- You can then add a directional light (from the Create menu on the upper left) to illuminate the hands.
- You can also add objects into the scene and put them near the controller. To interact with the objects, click on the Cube, then Add Component, and add Rigidbody. Be sure to disable gravity so that the object doesn’t fall away (you’ll see this in the Rigidbody properties.)