The forum on this site is closed for new comments and posts. Continue the conversation in our Snap AR Discord server.

AR Object Camera Focus

  • Hi Jordan,

    Sorry to hear you're having that issue! This doesn't sound like it could be caused by your lens, is it happening with other lenses too? Do you see it in Snapchat without lenses turned on, or in your phone's standard camera app?

    Sorry for all the questions, but it's hard to tell where the problem could be happening. If you'd like to share some information about your phone (iOS/Android, device model) that could help as well.

    Thanks,
    Jacob

    Comment actions Permalink
  • Hi Jacob,

     

    Thanks for the response. I am using iPhone X with the latest version of iOS and Snapchat.

     

    I ran a few tests this morning and there are no focus issues with the standard camera app or other Snapchat filters. Because I did not have another static object Lens, I synced the example in Lens Studio and it seems to allow me to easily tap the subject (for example a person) after I've tapped the ground and placed the object. Tapping the subject puts them in focus. My Lens' static object is tall and skinny and I think it might have something to do with the box you place around it.

     

    Any suggestions? I have submitted a photo to show you what my lens looks like.

    Comment actions Permalink
  • Hey Jordan, thanks for the info and picture! 

    Like you mentioned, it's likely caused by the "TouchCollision" object. Since it's used for manipulating the main object, it blocks any taps that touch it from being registered as focusing. So it could be the case that it's too big and is blocking the entire screen.

    What you can do is resize the TouchCollision object to better fit the boundaries of your model. The Frame Tool is really helpful for this - you can use the hotkey "T", or look for this icon in the 3D toolbar:

    Toolbar and Shortcuts

     

    If that doesn't solve your problem, I have one more theory of what could be causing this. On your Device Tracking component, did you switch Tracking Mode to "World", or enable Native AR tracking? ARKit being active can sometimes prevent the phone camera from refocusing, so you can try changing Tracking Mode back to "Surface" and and disabling "Use Native AR" if all else fails.

    Hope this solves it! Let me know how it goes, or if you have any other questions about it.

    Thanks,
    Jacob

    Comment actions Permalink
  • Jacob,

     

    Thanks for the suggestions! I'll give it a shot and report back. Appreciate the awesome help.

    Comment actions Permalink
  • Jacob, that did the trick, it seems easier to tap to focus on the person now. 

     

    With that being said, I have another question you might be able to help with. Is there a tool, option or script to prevent the user from scaling/zooming in with the camera. I want users to be able to scale the static object, but not zoom in.

    Comment actions Permalink
  • Hey Jordan, glad that worked!

    You can block touch inputs using Touch Blocking. You just need to enable touch blocking, then add exceptions for all the touch types you still want to allow. To only block zooming, you can use a script like this:

    // Enable global touch blocking
    global.touchSystem.touchBlocking = true;

    // Add exceptions for each touch type you still want to allow
    global.touchSystem.enableTouchBlockingException("TouchTypeTap", true);
    global.touchSystem.enableTouchBlockingException("TouchTypeDoubleTap", true);
    global.touchSystem.enableTouchBlockingException("TouchTypePan", true);
    global.touchSystem.enableTouchBlockingException("TouchTypeSwipe", true);

     

    Or, you can do it slightly more compactly too :)

    // Enable global touch blocking
    global.touchSystem.touchBlocking = true;

    // Add exceptions for each touch type you still want to allow
    ["Tap","DoubleTap","Pan","Swipe"].forEach(function(n) {
    global.touchSystem.enableTouchBlockingException("TouchType"+n, true);
    });
    Comment actions Permalink
  • Awesome! I'll give that a shot!

    Comment actions Permalink
  • yes its nice to see this feature but i tried tom apply it on my deviceher but cant access on it i will share the complete info with some one from you guys but if anyone knows why its happening bcz i need the guidance quickly.

    Comment actions Permalink

We're here to help! We just need a little bit of information...

What system are you using?

Have you downloaded the latest version of Lens Studio?

Please download the latest version of Lens Studio. If you still run into this issue, please come back and report it!

Is this issue causing Lens Studio to crash?

What system do you run Lens Studio on?

Version

Graphics

Follow the next steps to help us solve your issue:

  • Copy and paste this text into your TerminalCommand Window
    open ~/Library/Preferences/Snap/Lens\ Studio/ %LOCALAPPDATA%\Snap\Lens Studio Copy Text
  • Press ReturnEnter to run the command. The Lens Studio folder will automatically open
  • Prepare to upload your files: zip the "Log" Folder by right-clicking and choosing "compress."
    Locate the Log.txt file right above it.

    Attach a screenshot of the issue:

Name:

Email:

What is this most relevant to?

Please enter a brief description of your issue:

Thanks for submitting this issue.

Unfortunately, it's likely due to the operating system or hardware you're using – since they don't meet the system requirements for Lens Studio.

Still, we hear you loud and clear, and are logging the issue in case there's ever a workaround we can provide!

Minimum Requirements

Operating System: Windows 10 (64 bit); MacOS 10.11+

Hardware: Minimum of Intel Core i3 2.5Ghz or AMD Phenom II 2.6Ghz with 4 GB RAM; Intel HD Graphics 4000 / Nvidia GeForce 710 / AMD Radeon HD 6450 or better; screen resolution of 1280x768 or higher

We'll try to resolve this issue as soon as possible. Thanks for letting us know about it!

Keep an eye out for a followup email from us. We may have a couple more questions for you, or we might already have a solution to offer.

Happy creating!