"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

Camera Flipping Doesn't Work (Unity)

Hey everyone, I'm having trouble with my camera switching script for Android. This script works correctly on iOS, but on Android it's not flipping the camera from front to rear when clicked. Here's where it gets weird. If I click to another Unity scene within the app and return to the previous scene the camera will initialize to the camera most recently selected. I.e. I'm using front camera, click the button, nothing happens. I click to my "help" scene and then return to my "viewer" scene and the camera is now rear camera. Any thoughts?

This is the code snippet that I've been using and has been working correctly on iOS... I'm running Android 7.

 

public void OnSwitchCamera()     {         if (VuforiaConfiguration.Instance.Vuforia.CameraDirection == CameraDevice.CameraDirection.CAMERA_FRONT)             VuforiaConfiguration.Instance.Vuforia.CameraDirection = CameraDevice.CameraDirection.CAMERA_BACK;         else             VuforiaConfiguration.Instance.Vuforia.CameraDirection = CameraDevice.CameraDirection.CAMERA_FRONT;         Application.LoadLevel("ARCapture");     }

 

 

Hello cleverfoxvr,

The Core Samples provide some example code for switching between the front and back cameras. The MenuOptions.cs and CameraSettings.cs files contain code that will properly switch between the two cameras.