Scene loaded from .rcproject file doesn't show up in .nonAR mode on real iPhone 8

I tried to display a Scene loaded from a .rcproject file in ARView with .nonAR mode.

But could not display it on my iPhone 8 which is actual device. I have confirmed that the simulator display the scene properly. If the camera mode is set to .ar, the scene is displayed in actual device.

I am puzzled as to why scene loaded from .rcproject file does not show up with my actual device. If anyone has had the similar experience or has an idea of the cause, I would appreciate it if you could help me.

Thank you for taking the time to read this post.

struct ARViewContainer: UIViewRepresentable {

    func makeUIView(context: Context) -> ARView {
     
        //  if cameramode is ".ar", work properly
        let arview = ARView(frame: .zero, cameraMode: .nonAR)

        Sample.loadMySceneAsync { (result) in

            do {

                let myScene = try result.get()

                arview.scene.anchors.append(myScene)

            } catch {

                print("Failed to load myScene")

            }

        }
        
        let camera = PerspectiveCamera()

        let cameraAnchor = AnchorEntity(world: [0, 0.2, 0.5])

        cameraAnchor.addChild(camera)

        arView.scene.addAnchor(cameraAnchor)

        return arview
    }


    func updateUIView(_ uiView: ARView, context: Context) {}

}
Post not yet marked as solved Up vote post of polaris_ Down vote post of polaris_
833 views

Replies

Using Xcode14 and iOS version is 16.0

  • Using Xcode14 for iPhone12 mini (iOS 16.03) cause the same problem. But scene showed properly using Xcode14 and iPad Pro mini (iPad OS 15.7) .

  • Using Xcode14 for real iPhone12 mini (iOS 16.03) cause the same problem. But scene showed properly using Xcode14 and iPad Pro mini (iPad OS 15.7).

Add a Comment