I have an ARKit view (1st view) in which I set nodes to certain positions. Then, I would like to allow the user to go to the 2nd view but also be able to return to the ARKit view by clicking on the return button. The button makes an unwind to the ARKit view but when it does, the positions of the nodes are changed depending on the position of the phone. Can I somehow omit that? I want the nodes in the same places as they were the first time, regardless of the new position of the phone
1 Answers
I think your challenge is pretty hard to sort out, indeed when moving to 2nd view the session of the 1rs one is "paused" so a solution should be coded in part in the "viewWillDisappear" function, but due to the strong relation between the device’s motion sensing hardware and the camera there is input from those elements while the session is paused.
I would try by creating a big ARanchor plane (ex. all the floor) and making sure to disable the plane detection before moving to 2nd view, then re-enable (or not) the detection depending on the "presentation.position" of the nodes. I mean before moving to 2nd view try to store some node.presentation.position of the all nodes present (camera, floor, nodes, etc)
Perhaps would try with a big SCNBox node on top of an anchored plane and then putting the visible nodes inside the SCNBox...