Two lines of code for Reality Composer to XCode

Hi there all,


I've got several apps out there but am just getting started with AR, so I apologize if this seems really basic. In the WWDC19 Video, we are told that we can make XCode display a Reality Composer project with two lines of code. (41 minutes in) I cannot for the life of me get this to work. Has anyone else succesfully modified either the Ship project or the Strike Bowling Sample Code to load their own scene? If so, please share how!


I've got scenes ready in Reality Composer but cannot figure out where to load them up in XCode. Thanks,


Pete

Answered by dulanyconsulting in 371653022

Wow, I missed something really simple - for anyone else that stumbles upon this, I was using the "SceneKit" framework which is the default instead of "RealityKit." Once you see the code for the ViewController, it's remarkably easy to see the code. Just find the line that starts with


let boxAnchor =


and put the name of your RC project.loadScene()

Accepted Answer

Wow, I missed something really simple - for anyone else that stumbles upon this, I was using the "SceneKit" framework which is the default instead of "RealityKit." Once you see the code for the ViewController, it's remarkably easy to see the code. Just find the line that starts with


let boxAnchor =


and put the name of your RC project.loadScene()

Two lines of code for Reality Composer to XCode
 
 
Q