Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Can't access the 4K camera on my iPhone

Discussion in 'AR' started by john918063, Apr 12, 2023.

  1. john918063

    john918063

    Joined:
    Aug 24, 2022
    Posts:
    3
    I have followed the description below to request a 4K camera configuration.
    https://docs.unity3d.com/Packages/com.unity.xr.arkit@5.1/manual/whats-new.html
    But still can't access the 4K camera on my iPhone.

    I found that when the code runs to cameraManager.GetConfigurations(Allocator.Temp), it returns nothing to me.

    I want to ask if someone can help me with my problem.

    My unity version is at 2021.3.19, AR Foundation 5.1.0-pre.3, ARKit XR Plugin 5.1.0-pre.3.


    iPhone 14 Pro with iOS 16.4.1.
     
  2. WyattBUnity

    WyattBUnity

    Unity Technologies

    Joined:
    Mar 27, 2023
    Posts:
    43
    If cameraManager.GetConfigurations is returning nothing, then that would be a bug. Please file a bug and if you can link us the bug/ticket number after you submit it, that would allow us to take a look at it.
     
  3. john918063

    john918063

    Joined:
    Aug 24, 2022
    Posts:
    3
    I successfully access the 4K camera on my iPhone.

    I found out that if followed the code in the description, it will request the camera configuration at the same time as the app starts, and this will return nothing to me.

    So I set up a button to manually request the camera configuration after the app finished loading the scene, and everything worked fine.
     
  4. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,025
    It requests the configuration one frame after app start actually. Note the yield return new WaitForEndOfFrame: https://docs.unity3d.com/Packages/com.unity.xr.arkit@5.1/manual/whats-new.html

    Are you saying camera configurations were still not available on the following frame? I've never seen that
     
  5. john918063

    john918063

    Joined:
    Aug 24, 2022
    Posts:
    3
    I have noticed that it requests one frame after app starts, but it still doesn't work.

    So I tried various other methods and finally got it working when manually requesting it.
     
  6. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,025