Topic has a solution and is locked
Log in or register to post comments

Setting the Camera Focus Mode

August 25, 2016 - 3:43am #1
Topic solved

Hi there,


I am a 3D artist with very (very) low level in programming. We are trying to set up an AR visit card with few issues. The badest one is that the android phone camera do not auto focus properly the card, due to its small size (85x55 mm). Then, I'm trying to implement the code shown on the Camera Focus modes page from the "How to" section (


The thing is I have absolutely no clue where to paste the unity snippet code, nore if I have to create a new script, or even attach it to any object on the scene (on ARcamra prefab I suppose ?)


Does anyone have a "how to set camera focus mode in unity for dummies" kind of tutorial ?


Many thanks !!

Setting the Camera Focus Mode

September 21, 2021 - 5:08am #7

Hey there,


You should use the updated camera sample:

There's also a Vuforia video tutorial on our Youtube channel:

Can you elaborate on where you found the code you are using? We've been getting more people having issues with the camera samples and I would like to understand where these samples are found.



Kind regards,

Patrick Scheper

Technical Community Manager

Image icon Autofocus Thumbnail.png677.05 KB

Setting the Camera Focus Mode

September 19, 2021 - 12:35pm #6

Hi, can anyone help me find the solution on scripting AR Camera Auto Focus?

I have Vuforia Engine 10.1 and Unity 2020.3.18f1.

I attached the screenshot showing multiple errors.

Image icon VuforiaCam.png138.95 KB

Setting the Camera Focus Mode

April 4, 2018 - 5:40pm #5

Unity 2017 and Vuforia  Augmented Reality (AR) Camera Auto Focus

Show this video to how create Camera AutoFocus with vuforia

Setting the Camera Focus Mode

June 22, 2017 - 3:28pm #4


Apologies for the inconvenience. We have been updating and consolidating our library documentation recently and are still working through broken links.

You can find the article you were looking for here:

In the future if you hit any additional broken links, the best thing to do is search our library articles:

Lastly, the script you're looking for can be found in Assets/Common/CameraSettings.cs


Setting the Camera Focus Mode

June 22, 2017 - 10:00am #3

Hi, the link is broken;

Also I can't find the Camera Focus Mode setting in the AR Camera Vuforia configuration script.  Has it been replaced by Camera Device Mode?

Setting the Camera Focus Mode

November 22, 2016 - 1:07am #2



I'm not sure if u've alr solved the issue.

The easiest way is to create a new c# script, name anything, and paste the snippet code. And attach the script to the Camera GameObject under the ARCamera prefab. Worked just fine for me. :)



Image icon camfous.JPG49.25 KB
Log in or register to post comments