You can add the Hand Tracker object to your Scene panel to create effects that respond when the camera detects a hand.
Download the sample content to follow along. In the finished effect you'll see that when you wave your hand, it looks like you're holding a baseball.
This tutorial uses a simple method for adding hand tracking to your effect without the Patch Editor. More complex effects can be achieved by using hand tracker and bounding box patches.
If you are confident with the patch editor, you may want to try our intermediate tutorial on the bounding box method. Alternatively, you can read an overview of the two methods for creating hand tracking effects.
To see what an effect with hand tracking looks like, you'll need to switch on your computer's camera. This will let you see your own hands in the Simulator when it comes to testing out the hand tracking effect.
To do this:
Start by adding a hand tracker to the scene:
In the Simulator, you'll see an instruction saying Hold up a hand!.
This is an automatic instruction that's added to all effects with a hand tracker. If you hold up a hand, the message will disappear. Find out more about adding instructions.
We've already added a 3D object to the project. It's listed in the Assets panel as baseball. The object looks like, you guessed it, a baseball.
You could try out hand tracking with another object if you wanted - there are lots to choose from in the AR Library.
To make the object appear in response to a hand, the object should be a child of the hand tracker in the Scene panel. When an object is a child of another object in Spark AR Studio, it'll respond to its parent object - in this case, appearing when a hand is detected.
To create a child-parent relationship, all you need to do is drag one object onto another in the Scene panel:
You can drag the baseball object directly from the Assets panel, onto the hand tracker in the Scene panel. This will add the object to the scene at the same time as creating the relationship with the hand tracker.
Because the object is a child of the hand tracker, it's nested underneath it in the Scene panel.
And there you have it, an effect with hand tracking!
Change someone’s environment with segmentation and the camera texture.
Add a color filter to your AR effects by changing the hue and saturation.