M1 Interactive recently partnered with Leap Motion to create a freely available starter kit for all developers who want to build the next generation of games on the Unity platform. This is the final post in a three-part series (part one and part two).

Note: The Starter Kit has been deprecated. Be sure to download our Unity Core Assets (or Core Assets: VR Edition) from developer.leapmotion.com/downloads/unity.

Are you ready for takeoff? So far, we’ve showed you how our Leap Motion Starter Kit for Unity3D provides players with in-game tools and control mechanisms that mimic real-world interactions, and highlighted four games in the Airspace Store that combine Unity3D and the Leap Motion SDK in exciting and innovative ways. In our final post, we look at two key challenges that we faced and how they can be overcome. Plus, we’ll review some of the cool extras that we built into the kit.

Designing for two-handed interactions

Our goal with the Leap Motion Starter Kit was to allow users to interact with game objects using both hands. Naturally, this required us to be able to differentiate between left and right hands, which proved to be an issue with certain scenes. For example, in the boxing scene, the player would sometimes bring their hands in with the fists closed, making it hard to determine whether it was a left or right hand. Also, in the weapons scene, the user aims the gun using the index finger, so it was required to discern between the hands as well as the fingers. We overcame these hurdles by implementing code that predicts and updates information from the Leap Motion Controller to correctly assign the hands and the fingers.

Another interesting problem arose in the driving scene. In real life, when grabbing a steering wheel with both hands, when one hand moves, it makes the other hand move as well – because the steering wheel is rotating. However, since we’re not physically grabbing anything above the Leap Motion Controller, the other hand doesn’t move automatically.

To solve this, we simply made it so that one of the hands is dominant in controlling the steering wheel. From there, other methods can be used to calculate the median distance between the two hands to approximate the rotation of where the steering wheel. This is one of the key issues in developing with the Leap Motion Controller – sometimes what happens virtually in the world doesn’t always mimic the real world interaction. When this happens, it’s important to think creatively and seek alternate approaches.

Overcoming fatigue with ergonomics and flow

The issue of arm fatigue can be avoided with some forethought, and we designed the Leap Motion Starter Kit with this in mind. It allows for players to reposition and scale the position of their hands in Unity. If needed, they can change the interaction – so that they don’t need to raise their hands above the Leap Motion Controller as much.

Other solutions include allowing users to switch hands, or put their hands down from time to time, as just resting the hands for a few seconds helps fight fatigue greatly. Leap Motion’s website includes some ergonomics guidelines for users that are also helpful for developers.

In the bowling scene, after the user throws the bowling ball, they can relax their hands until the bowling ball reappears. The boxing scene is more intense and therefore should be played in rounds to allow the users time to rest their arms.

Developing with the Leap Motion Starter Kit

The beauty of the control scheme approach we came up with is that it allows for users to quickly and easily understand the controls without requiring explanation – since people generally know how to throw a ball, punch, or hold a steering wheel. With this approach, we created the potential to appeal to more casual gamers, or to users who would regularly not touch a video game because the controllers may be intimidating with a steep learning curve. Newer real-world interactions that are simpler to understand are a great way to appeal to the casual gaming market.

Using our starter kit, you can quickly and easily begin interacting with objects with your hands and fingers in Unity3D. We created tutorials that demonstrate how to define your own controls. When an object is picked up, you can make it behave as you wish. Whether the object shoots projectiles when mimicking a trigger-pulling motion with your hand, uses collision physics to hit a punching bag, or deals damage when making a swiping motion with a sword, the kit is versatile enough to define custom controls but simple enough to quickly create fun interactions.

We also gave our starter kit built-in functionality that automatically determines left or right hands when a hand is introduced into the Leap Motion Controller’s view, and calculates finger indexes based on their positions. It also has the basic functionality you need to set up a rigged hand, so that virtual fingers move and rotate based on the movement of fingers within the device’s view.

We can’t wait to see what you’ll create

Since the early days of computing, people have been anticipating the possibilities of virtual reality – the ability to directly interact with and control unreal environments. Now that future is finally here. Video games are a driving force in refining cutting-edge interactivity and creating immersive virtual worlds, and will be the leading force in continuing to advance this technology.

We hope that our starter kit for the Leap Motion Controller will be a useful starting point for all Unity3D developers, and we’re looking forward to improving the tool and adding new features based on your feedback. Future releases will focus on adding easy-to-use GUI functionality, a framework for gesture controls, and precise controls for interacting with objects with two handed controls. Let us know what you think about the project in the comments and share your work. We would love to see what you come up with.