Will a Reality Composer project file with 2 scenes play in Xcode?

Viewed 327

I am using Reality Composer and have 2 scenes in a project file.

Will both of those scenes play in my Augmented Reality app?

1 Answers

You can have as many Reality Composer scenes in your AR app as you wish.

Here is a code snippet how you could read in Reality Composer scenes:

import RealityKit

override func viewDidLoad() {
    super.viewDidLoad()

    let sceneUno = try! Experience.loadFirstScene()
    let sceneDos = try! Experience.loadSecondScene()
    let sceneTres = try! Experience.loadThirdScene()

    arView.scene.anchors.append(sceneUno)
    arView.scene.anchors.append(sceneDos)
    arView.scene.anchors.append(sceneTres)
}

Also, you could read this post to find out how to collide entities from different scenes. In other words, RealityKit app can mix and play several Reality Composer scenes at a time.

Related