Hand
The Hand Template lets you create Lenses that add images or animations to a hand found in the camera. The template also gives an example script for adding interaction when a hand is found or lost.
Video Walkthrough
Template Walkthrough
Switch Preview Video
When working with the Hand Template, you'll want to switch the preview video to one with a hand. In the Preview
panel, press the Image / Video Mode
button. Then, in the drop down at the top of the Preview
panel, select the Hand
preview video. You should now see the template working with content applied to the preview model’s hand. You can also switch to Webcam in the Preview
panel and see the content attached to your own hand.
Add Resource
For the Hand template, we should first import a 2D texture or animation into the Resources
panel. To do this, drag and drop a PNG
, JPG
or GIF
into the Resources
panel from your computer.
Configure Hand Tracking Controller
With the HandTrackingController [EDIT_ME]
object selected in the Objects
panel, we'll configure its settings in the Inspector
panel. The Hand template allows you to configure the image attached to the hand. I can assign my custom texture that I imported into my Resources
panel to the Texture
field. Finally, I can adjust the Size
, Offset
, Rotation
and Alpha
of the content with the corresponding sliders.
Additionally, if desired, I can enabled Smooth Following
which will more loosely attach the content from the hand and includes a tunable Smoothing Speed
.
Adding Hand Found, Hand Lost Interaction
The Hand template gives an example for adding interaction when a hand is found or lost in the camera. In the template, a 3D and 2D animation is played when the hand is either found or lost. In the template, take a look at the HandHatController.js
script in the Hand Tracking Template Content -> Scripts
folder. To create your own custom interaction, adding the following script bound to Initialized to anywhere in the Hand Template will trigger the interaction.
script.api.onObjectFound = function () {
// Add on Hand found logic here
print('Hand Found');
};
script.api.onObjectLost = function () {
// Add on Hand lost logic here
print('Hand Lost');
};
Adding Hand Tracking Outside of Template
While the Hand template gives you a simple way to add 2D images and animation to the tracked hand, you can also always add Hand tracking outside of the template. To do this, select + -> Object Tracking -> Hand`` Tracking
from the Objects
panel. You can then edit the position, scale and rotation of the added element in the 2D scene.
Object Tracking and 3D Objects
It is possible to attach 3D Objects to Object Tracking by adding a helper script. Please refer to the Object Tracking & 3D Objects section of the Object Tracking guide for more information.
Submitting Your Lens
You’re now ready to submit your Lens! Follow the guides below: