I'm building a small AR app with Xcode and Reality Composer which display shapes on different QR code but I'm having a problem. The App combine 4 different scene with different shapes and QR code. When I click on the object in scenea_0, it replace it with scenea_4, and if I tap again on it, it replace it with scenea_8. Each scenes have their 3 variation The issue I'm having is that the first click always work, but then it doesn't work so much, only depending the point of view and the place I'm clicking on the screen. Using arView.debugOptions.insert(.showPhysics) I discover a frame in my scene, and it seems that the function only work when I click through this frame.
I'm fairly new to Xcode, and I have no idea what this frame is. I would be grateful if anyone could help me with that.
As you can see on the right there's a frame from which the iPad started, and I can only trigger the "tap to change the scene" from this frame.
here's a bit of my code: `struct ARViewContainer: UIViewRepresentable {
func makeUIView(context: Context) -> ARView {
let arView = ARView(frame: .zero)
arView.debugOptions.insert(.showPhysics)
let anchorOne = try! PreviewRC.loadScenea0()
let anchorTwo = try! PreviewRC.loadSceneV0()
let anchorThree = try! PreviewRC.loadSceneg0()
let anchorFour = try! PreviewRC.loadScenee0()
let anchorFive = try! PreviewRC.loadSceneTBD1()
let anchorSeven = try! PreviewRC.loadSceneTBD2()
// Add the box anchor to the scene
arView.scene.anchors.append(anchorOne)
arView.scene.anchors.append(anchorTwo)
arView.scene.anchors.append(anchorThree)
arView.scene.anchors.append(anchorFour)
arView.scene.anchors.append(anchorFive)
arView.scene.anchors.append(anchorSeven)
return arView
}
func updateUIView(_ uiView: ARView, context: Context) {}
}`
While I tried different solution, I don't know how can I make it work with Reality Composer and Xcode…