Need to disable reset on tap for marker

Hello,

I need to allow events on tap without resetting the model in a marker project. I added the following line, which does enable my tap-based events to occur (in the app only, not in lens studio).

global.touchSystem.touchBlocking = false;

However, the model still resets (flashes in and out) on tap. Is there another way to not only re-enable touch but to disable the reset entirely as well?

Answers

  • Bakari Mustafa
    Bakari Mustafa Posts: 178 🔥🔥🔥
    edited August 2023 #2

    Hi @Irina , you have to enable touch blocking: https://docs.snap.com/api/lens-studio/Classes/ScriptObjects#TouchDataProvider

    global.touchSystem.touchBlocking = true;
    
    

    This will disable the swipe, zooming, and all the default touch behaviors. You can re-enable the ones you don't want to block by using enableTouchBlockingException, there's an example on that doc page

  • To prevent your model from resetting when tapped in a Lens Studio marker project, review your script and marker settings for any code or configurations related to model behavior on touch events. Look for animation events, triggers, or visibility settings that might be causing the reset and adjust them accordingly. If you're unable to find a solution within Lens Studio, consider seeking help from the Lens Studio community or documentation.