3

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

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

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
skynard
  • 133
  • 5

1 Answers1

1

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.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • So even if I create multiple scenes in the reality composer file, in xcode contentview, the code has to be written as to which scenes to play? When I used the default Experience.rcproject and added an additional scene to it, only the "box" scene would play. – skynard Jun 14 '20 at 20:45
  • Sorry @skynard, what do you mean saying "scene plays"? Animation? As you see in a link in my answer, you can mix 2 or more different scenes and they all can play simultaneously. – Andy Jazz Jun 15 '20 at 02:29
  • @skynard, have you tried to mix two RC scenes in RealityKit? – Andy Jazz Jun 15 '20 at 16:19
  • 1
    That worked perfectly. That was my first bit of writing code. Much appreciated. I have not tried to mix 2 scenes. We are creating an experience with audio so my big challange is to place nodes for audio and the avaudioplayer commands. Any suggestions as to books or guides for those steps. – skynard Jun 15 '20 at 20:25
  • Create the next question on audio, please. Don`t mix two topics here))))) – Andy Jazz Jun 16 '20 at 03:17