Hand Assets

The Leap Motion core assets for Unity include a number of pre-made hand prefabs assets. You can use these prefabs as-is, modify them, or create your own.

There are a few different approaches to creating hands, including creating discrete components for the parts of the hands and moving these parts individually, creating mesh hands rigged with bone armatures and deforming the mesh by rotating the bones, and even creating code-driven hands that procedurally create their own graphics. The existing prefabs use all three of these approaches.

The HandController class orchestrates the acquisition and application of tracking data to the hands and fingers. The HandModel and FingerModel classes serve as base classes for hand and finger animation. There are several classes extending HandModel and FingerModel to implement the specific types of animation. These specific classes, like SkeletalHand/Finger and RiggedHand/Finger, can be used for multiple hand designs as long as the objects to which they are attached follow the same basic structure.

The graphics and physics hands are separated into two different prefabs. You can use whichever physics hand prefab best fits your hand graphics model. For example. RigidFullHand includes a rigid body and collider for the arm, so you can use it with graphics models that include an arm – when you want the arm to collide with other objects in the scene.

Hand Type Prefabs Scripts Example
Image Hands ImageFullHand RiggedHand/Finger https://di4564baj7skl.cloudfront.net/documentation/v2/images/unity/Unity_ImageHand.png
Procedural Hands PolyHand1/2/3, DebugHand PolyHand/Finger, DebugHand/Finger https://di4564baj7skl.cloudfront.net/documentation/v2/images/unity/Unity_PolyHand.jpg
Component Hands MinimalHand, CleanRobotHand, GlowRobotHand SkeletalHand/Finger https://di4564baj7skl.cloudfront.net/documentation/v2/images/unity/Unity_RobotHand.jpg
Rigged Hands All the human models RiggedHand/Finger https://di4564baj7skl.cloudfront.net/documentation/v2/images/unity/Unity_SaltLightHand.jpg
Physics Hands RigidHand, RigidFullHand, RigidRoundHand, ThickRigidHand RigidHand/Finger https://di4564baj7skl.cloudfront.net/documentation/v2/images/unity/Unity_RigidHand.png

Setting Up Hand Assets in the Hand Controller

After adding a HandController to a scene, you can set the graphics model by dragging the desired hand prefab to the Hand Graphics Model slots.

https://di4564baj7skl.cloudfront.net/documentation/v2/images/unity/Unity_HandControllerGraphics.png

If the Separate Left/Right setting is checked, you can use different prefabs for the right and left hands. Otherwise, the HandController mirrors a single model for both hands. The existing hand prefabs are all labeled “right” or “left” where it makes a difference (if you use the wrong hand model, the error will be obvious).

Change the size of the hands using the Transform Scale value of the HandController prefab. A scale of 1.0 is life-size, but that is often too small. It really depends on your scene. The edges of the default Unity cube, for example, are 1 meter long and would dwarf a life-size hand. Scaling the hands larger also increases their range of motion. You can further increase the range of motion without making the hands larger by increasing the HandController Hand Movement Scale values.

Note that in VR and AR scenes, you should use a 1:1 scale with reality. Since the Leap Motion tracking data is already in real-world units, set the HandController scale to 1 and position the HandController object in the same position relative to the camera as the real device is positioned relative to the center point between your eyes. For VR/AR apps, the LMHeadMountedRig prefab in the LeapMotionVR folder should be used instead of the HandController prefab and makes these adjustments automatically.

Setting the Is Head Mounted will provide a hint to the Leap Motion service that hands are viewed from the head-mounted position and improve hand recognition. The setting does not automatically rotate the hands in the game to appear in front of the HandController rather than above it. To do that, you can set the HandController rotation values to {x=270, y=180, z=0}.

Note: The Image Hand assets are designed for AR/VR use. These assets also have several script, shader, and game object dependencies. Simply adding ImageFullHands to a HandController object is not sufficient. See Using the Image Hand Assets in version 2.3.1 for information about using the image hand assets.