I'm trying to anchor a 3d model onto a real-world image, in my case a QR code... It works fine within Reality Composer, however, I attempted to add it into my RealityKit project and nothing is showing up in my ARView... Nothing relevant is printed in the console.
Here is my code:
struct MainARView: UIViewRepresentable {
func makeUIView(context: Context) -> ARView {
let view = ARView()
let session = view.session
let config = ARWorldTrackingConfiguration()
session.run(config)
view.debugOptions = [.showFeaturePoints,
.showAnchorOrigins,
.showAnchorGeometry]
guard let anchor = try? TestObj.loadScene() else {
print("Error loading TestObj")
return view
}
view.scene.addAnchor(anchor)
return view
}
func updateUIView(_ view: ARView, context: Context) { }
}
Any help would be much appreciated