how does Xcode receive the behaviour signal from Reality Composer?

In Reality Composer, a behavior can send signal to Xcode, but i dont know how to receive these signals.

after loading the scene with Experience.loadMyScene() as MyScene, I explored MyScene.Actions, i can see such behaviors fall there. However i dont know what is next step. Should I subcribe them like they are events?

Replies

I know this is an older thread but here is how you can have a Reality Composer behavior with a notify action signal Swift. In the code below "myNotifyAction" is what the Reality Composer Notify action is configured to call.

func handleOnNotifyAction( entity: Entity?) {
// handle Reality Composer notification here    
}

func loadRealityComposerScene() {
MyRealityScene.load
MyEntityAsync(completion: { (result) in
      do {
        let scene = try result.get()
        scene.actions.myNotifyAction.onAction = self.handleOnNotifyAction(_:)
      } catch {
        print(error.localizedDescription)
      }
    })
}