0

I currently have an application using RealityKit to add AR content to the view. I have a button that allows the user to take a photo. Based on the documentation, ARView.snapshot() seems to do this. However, the image captured is not including the AR content(3D object).

ARViewContainer().arview.snapshot(saveToHDR: false) { image in
    UIImageWriteToSavedPhotosAlbum(image!, nil, nil, nil)
}

There is no error with this function but the captured snapshot is only a "camera photo" but no containing the AR Content(3D object) that is in the ARView.

Asperi
  • 228,894
  • 20
  • 464
  • 690

1 Answers1

2

It looks like you're creating a new ARViewContainer every time you create a snapshot, and that ARView will be fresh without any 3D content in it.

You'll want to instead reference the current ARViewContainer to grab the ARView within that.

maxxfrazer
  • 1,173
  • 6
  • 15