"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Autofocus script problems

Hello

I have been having problems getting the camera autofocus script to work. I'm new to this so all help will be appriciated.

the code i used for the script is from the Vuforia website

void Start()     {         VuforiaApplication.Instance.OnVuforiaStarted += OnVuforiaStarted;         VuforiaApplication.Instance.OnVuforiaPaused += OnPaused;     }

    private void OnVuforiaStarted()     {      VuforiaBehaviour.Instance.CameraDevice.SetFocusMode(FocusMode.FOCUS_MODE_CONTINUOUSAUTO);      VuforiaBehaviour.Instance.CameraDevice.CameraMode = CameraMode.MODE_DEFAULT;     }

    private void OnPaused(bool paused)     {         if (!paused) // Resumed         {             // Set again autofocus mode when app is resumed             VuforiaBehaviour.Instance.CameraDevice.SetFocusMode(                 FocusMode.FOCUS_MODE_CONTINUOUSAUTO);         }     }

 

and i get the error

Property or indexer 'CameraDevice.CameraMode' cannot be assigned to -- it is read only

thanks for ur help in advance

Hey there,

 

Thank you for reporting! I expect that VuforiaBehaviour.Instance.CameraDevice.CameraMode is only used when you want to check which mode is currently being used. To set the mode, please use: