Clear
Back

Using the Object Tap Patch

Use the Object Tap patch in Spark AR Studio to make something happen in your effect when someone taps a specific object.

In this guide, we'll make an object get bigger when someone taps directly on it:



You could use other screen interaction patches to achieve similar effects, like Screen Tap or Screen Pan.

Creating an Object Tap patch

To create an Object Tap patch:

  1. Add an object to your scene - we've used a plane with a material and texture applied to it.
  2. Select the object in the Scene Panel.
  3. Go to Interactions in the Inspector.
  4. Next to Patch, click Create.
  5. Select Object Tap.

Two patches will be created:

  1. A producer patch representing the object.
  2. An Object Tap patch, connected to the producer patch.

Making an object respond to a tap

Next create a patch representing the property of the object you want to change. For this example:

  1. Select the object in the Scene Panel.
  2. Click the arrow next to Scale in the Inspector.

You could choose a different property instead. For example, Position to move the object to a different position or Visible to make it disappear.

Right-click in the Patch Editor and select:

  • A Loop Animation and Transition patch - we’ll use these patches to set how the object animates.
  • A Switch patch - to create a switch each time the object is tapped, telling the animation to start or stop.

You’ll see 6 patches in the Patch Editor:



Connect the patches, so your graph looks like this:



In the Transition patch, adjust the values next to Start and End to set the starting and ending scale of your object. We set:

  1. The Start value to 0.
  2. The End value to 4.

You could experiment with changing the Curve option in the Transition patch, to change the shape of the movement. Or, change the speed by editing the Duration value in the Loop Animation patch.

Join the Spark AR Creator's community

Find inspiration, see examples, get support, and share your work with a network of creators.

Join Community

Join the Spark AR Creator's community

Find inspiration, see examples, get support, and share your work with a network of creators.

Join Community

Frequently asked questions

Have a specific question? Maybe it's been answered.


Read FAQs
Was this document helpful?