AR Bootcamp
Published in

AR Bootcamp

How to add a tap-to-change feature with Lens Studio

Tap to Change with Lens Studio
Tap to Change with Lens Studio
Snapcode for example lens where you can tap to cycle through something
Snapcode for example lens where you can tap to cycle through something

Scene setup

Starting with a clean slate

Initializing our scene for the tap to change
Initializing our scene for the tap to change

Displaying the first item

Enabling our first object
Enabling our first object

Cycling through everything

Initializing our counter variable to 0
Initializing our counter variable to 0
Disabling the currently enabled object when the user taps
Disabling the currently enabled object when the user taps
Incrementing our counter variable
Incrementing our counter variable
Resetting our counter if it goes too high
Resetting our counter if it goes too high
Enabling the next item in the list
Enabling the next item in the list

Profit

Video version

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Michael Porter

I make Snapchat lenses and Instagram filters and I love teaching others how to do the same! I started https://arbootcamp.com/ to help everyone learn how.