How to tell if XRsession is initialized

Hi There,

I need to fire off a function > after < the XR session is initialized.

I can’t figure out what I need to use to produce an if statement around this.

I thought it was this…

    if (xr.baseExperience.sessionManager.onXRSessionInit)
      {
        console.log("hi");
      }

But that’s not quite correct; any ideas?

This is an observable to which you can add a callback - onXRSessionInit.add(myCallback)

1 Like

So, if you wanted specific code to initiate only once the XRSession was initialized, this is what you would use?

the name says it all :slight_smile:
Yes, this it ehe right observable to use for those cases

1 Like