Camera not working


#1

Hello all,

I have been working a few weeks with the Aryzon SDK with the newest Unity, which is great so far. However, when I play around with the VuforiaTracking sample scene, I am running into some problems. Sometimes when I run the app on my phone (a Samsung Galaxy S7) it’s working fine, but when I rotate my phone to get the ‘put phone in the aryzon’ and rotate back, I can’t detect any images anymore. Sometimes it also happens when I just started up the application. Since I detected the images before, my guess is that the camera is not working properly anymore. I can’t really find the script which starts and stops the phone camera.

Any help is greatly appreciated :slight_smile:


#2

Hi Remco,

I’m unfamiliar with this issue, however perhaps it has something to do with Vuforia being disabled and not being re-enabled when rotating back to landscape. Have a look in the ARMode.cs script. You might have luck by adding this:

#if USE_VUFORIA
	if (vuforiaBehaviour) {
		vuforiaBehaviour.enabled = true;
	}
#endif

to here:

if (!rotated && arMode && !autoRotate) {
	if (Screen.orientation == ScreenOrientation.LandscapeLeft) {
		if (cameraUI) {
			cameraUI.clearFlags = CameraClearFlags.Depth;
		}
		putInAryzonImage.SetActive (false);
		SetActiveCamsAndMenus (true);

	--Insert here--
..
		shifter.UpdateLayout ();
	}

}

Let me know if this helps.


#3

This seems to do the trick! When I debug log the vuforiabehaviour and the cameradevice, both are disabled after rotating to portrait and back to landscape. When I rotate back and enable vuforiabehaviour, both are enabled again. While trying to fix this apparently I broke something else where it didn’t work at all, but not sure what I broke, so reverted back. Hopefully this was the fix I was looking for :slight_smile: