Group Group Group Group Group Group Group Group Group

Arkit scene view is only display 1 arkit object


#1

My code below is only displaying 1 arkit object in the touches began function. I would like the user to be able to display several of the same arkit objects in the arkit scene view. Right now the user is able to place a image but as soon as the next one is placed the other one is deleted.

                  override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {

//Handle the shooting
guard let frame = sceneView.session.currentFrame else { return }
let camMatrix = SCNMatrix4(frame.camera.transform)
let direction = SCNVector3Make(-camMatrix.m31 * 5.0, -camMatrix.m32 * 10.0, -camMatrix.m33 * 5.0)
let position = SCNVector3Make(camMatrix.m41, camMatrix.m42, camMatrix.m43)
let scene = SCNScene(named: "art.scnassets/dontCare.scn")!

// Set the scene to the view
   sceneView.scene = scene
  }

#2

@zalubski Do you still have issues with this?


#3

Yes I am still hoping for answer.