2

I'm new to Reality Composer and RealityKit. I've set up a .rcproject with multiple ImageTracking scenes.

Each are setup identically. At this point, when images are recognized, a cube is overlaid and has a tap gesture that should send a notification to Xcode.

In Xcode, I'm loading each of the scenes and adding the anchor's to my ARView. When I run the app on my device, each image overlay displays, however only the first loaded anchor's Tap behavior works.

Is this how it's meant to work? Any suggestions on getting multiple image tracking behaviors to work from Reality Composer in Xcode. Any suggestions are appreciated.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Bryan M
  • 101
  • 6

1 Answers1

0

In order to enable a regular principle of interaction for image tracking objects, use:

(Behaviors) Custom -> (Trigger) Scene Start -> (Action) Show.

Code:

let cylinderScene = try! Experience.loadCylinder()       // with image anchor
let sphereScene = try! Experience.loadSphere()           // with image anchor
    
arView.scene.anchors.append(cylinderScene)
arView.scene.anchors.append(sphereScene)
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • Are you saying that I need to have a Scene Start -> Show behavior before other behaviors will work? – Bryan M Feb 25 '22 at 19:01
  • like this one - https://stackoverflow.com/questions/62796099/reality-composer-how-to-rotate-an-object-forever/62798722#62798722 – Andy Jazz Feb 25 '22 at 19:09
  • 1
    Ok. I have behaviors set up correctly. It's just only the first scene loaded works as intended. If I switch the order they load, they all work, in turn. It's quite odd. I have gotten my project working, but I'm creating most of my interactions via code. Only animations run from the Reality Composer file. Thanks for your help, though! – Bryan M Feb 25 '22 at 20:31