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,
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:
I wanted to let you know that
I wanted to let you know that based on your feedback the outdated documentation was corrected!
Kind regards,
Patrick Scheper
Technical Community Manager