• Public
  • Public/Protected
  • All

The WebXR Eye Tracking feature grabs eye data from the device and provides it in an easy-access format. Currently only enabled for BabylonNative applications.





disableAutoAttach: boolean

Should auto-attach be disabled?

isDisposed: boolean

Is this feature disposed?

onEyeTrackingEndedObservable: Observable<void>

This observable will notify registered observers when eye tracking ends

onEyeTrackingFrameUpdateObservable: Observable<Ray>

This observable will notify registered observers on each frame that has valid tracking

onEyeTrackingStartedObservable: Observable<Ray>

This observable will notify registered observers when eye tracking starts

xrNativeFeatureName: string

The name of the native xr feature name (like anchor, hit-test, or hand-tracking)

Name: "xr-eye-tracking" = "xr-eye-tracking"

The module's name

Version: 1 = 1

The (Babylon) version of this module. This is an integer representing the implementation version. This number does not correspond to the WebXR specs version


  • get attached(): boolean
  • Is this feature attached

    Returns boolean

  • get isEyeGazeValid(): boolean
  • Returns whether the gaze data is valid or not

    Returns boolean

    true if the data is valid


  • attach(force?: boolean): boolean
  • attach this feature


    • Optional force: boolean

      should attachment be forced (even when already attached)

    Returns boolean

    true if successful, false is failed or already attached

  • detach(): boolean
  • detach this feature.

    Returns boolean

    true if successful, false if failed or already detached

  • dispose(): void
  • Dispose this feature and all of the resources attached.

    Returns void

  • Get a reference to the gaze ray. This data is valid while eye tracking persists, and will be set to null when gaze data is no longer available

    Returns Nullable<Ray>

    a reference to the gaze ray if it exists and is valid, returns null otherwise.

  • isCompatible(): boolean
  • This function will be executed during before enabling the feature and can be used to not-allow enabling it. Note that at this point the session has NOT started, so this is purely checking if the browser supports it

    Returns boolean

    whether or not the feature is compatible in this environment


  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static property
  • Static method