Closed crandersn closed 2 years ago
There is no configuration that support both Raycast and User Facing Camera features at the same time. If both are requested at runtime then the ConfigurationChooser
will choose the configuration that has the maximum number of requested features.
To disable the Raycast feature, try disabling the ARRaycastManager
.
if (m_CameraManager.requestedFacingDirection == CameraFacingDirection.User)
{
if (rayCastMgr != null)
rayCastMgr.enabled = true;
Debug.Log("changing to rear facing camera");
m_CameraManager.requestedFacingDirection = CameraFacingDirection.World;
Debug.Log(m_CameraManager.currentFacingDirection);
}
else
{
if (rayCastMgr != null)
rayCastMgr.enabled = false;
Debug.Log("changing to front facing camera...");
m_CameraManager.requestedFacingDirection = CameraFacingDirection.User;
Debug.Log(m_CameraManager.currentFacingDirection);
}
Thank you so much! This resolved my issue
Hello,
I am new to Unity and ARFoundation and I am having an issue with switching between the front facing and rear facing camera. I currently have a demo application working which allows me to use the rear facing camera to do ray casting and place an AR object in the real world. However, whenever I touch the screen to switch to my front facing camera, my debug statements indicate that the requested camera was changed, but the application does not actually change which camera I am using. I am wondering if this has something to do with attempting to use ray casting on the front facing camera. I am ok with not being able to use ray casting with the front facing camera, but I would like to know how to disable ray casting so that I can switch to the front camera to enable some other functionality. My eventual goal is to use the rear facing camera for 3D object placement and use the front facing camera for face tracking. If anyone could help me figure out how to accomplish this that would be awesome! I have attached my code and a couple relevant screenshots below. Thanks!