Search Unity

Question ARCameraManager won't let me use the front camera?

Discussion in 'AR' started by Aaron-Meyers, Jan 16, 2023.

  1. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    I've got a very simple AR testing app. I'm trying to test face tracking, but I can't even get the AR Camera Manager to let me use the Front Camera. In the inspector, the ARCameraManager's Facing Direction property is set to "User".

    I created some UI to help test during runtime. When I print the currentFacingDirection property to a text field when the app starts on my phone, it says World. I have a button to set the requestedFacingDirection property to User and when I tap it, nothing happens. I am not using any other ARKit feature components in the scene that would cause it to choose World over User when it starts up, but even then, shouldn't it respect the requests I'm sending?

    Am I missing something obvious?

    Phone is an iPhone 14 Pro.
     
  2. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    The ARFoundation Samples Face Mesh scene is pretty much the same as mine. Is there something I need to check in the Player Settings for iOS Platform?
     
  3. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    It's likely that your scene is requesting an incompatible set of features for user-facing camera configurations. AR Foundation's configuration chooser by default will try to enable as many requested features as possible, but not all features are available in all configurations.

    To learn more about the configuration chooser including how to override the default behavior, see this video:
     
  4. QuarterOcean

    QuarterOcean

    Joined:
    Jan 12, 2023
    Posts:
    1
    same problem...
     
  5. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,168
    The chooser did not solve the problem. The chooser are not getting the front facing camera into the array of descriptor in iphone 11 (ios 16.6)
     
  6. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    223
  7. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,168
    andyb-unity likes this.
  8. MalarkeyMcAuley

    MalarkeyMcAuley

    Joined:
    Jan 20, 2024
    Posts:
    2
    Hi - I'm doing the 'Set Up a Face Tracking Project' in Unity Learn and having the same problem. I've been through all the instructions multiple times and completed all the steps, as well as making sure Face Tracking is enabled in ARKit, but when I build, it always defaults to the world-facing camera on my iPad. Any ideas about what I could have missed? I'm sure others making apps all over the world would be screaming if this was a current bug. Here's the unit instructions I was following https://learn.unity.com/tutorial/se...0ad5edbc2a74a90fb74d#633cdf1eedbc2a3ad8847551
     
  9. MalarkeyMcAuley

    MalarkeyMcAuley

    Joined:
    Jan 20, 2024
    Posts:
    2
    Oh, perhaps it actually that my iPad 7th gen test unit doesn't support face tracking. Pretty sure this might be the problem, but leaving this here for anyone who might come looking for possible solutions.
     
  10. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    The camera's facing direction is controlled by your ConfigurationChooser. The default ConfigurationChooser will weight all requested features equally, so if your scene requests more features that require the rear-facing camera than those that require the user-facing camera, it will not switch to the user-facing camera.

    Learn more about this behavior and how to write your own ConfigurationChooser in this video: