Face tracking platform support
The AR Foundation XRFace
Provider plug-in | Face tracking supported | Provider documentation |
---|---|---|
Google ARCore XR Plug-in | Yes | Face tracking (ARCore) |
Apple ARKit XR Plug-in | Yes | Face tracking (ARKit) |
Apple visionOS XR Plug-in | ||
Microsoft HoloLens | ||
Unity OpenXR: Meta | ||
Unity OpenXR: Android XR | Yes | Face tracking (Android XR) |
XR Simulation |
Check for face tracking support
Your app can check at runtime whether a provider plug-in supports face tracking on the user's device. Use the following example code to check whether the device supports face components:
void Start()
{
if (LoaderUtility
.GetActiveLoader()?
.GetLoadedSubsystem<XRFaceSubsystem>() != null)
{
// XRFaceSubsystem was loaded. The platform supports face detection.
}
}
Note
This example code assumes that your app has already initialized XR.
By default XR initializes automatically when your app starts, but this is configurable via Project Settings > XR Plug-in Management > Initialize XR on Startup. Refer to the XR Plug-in Management End-user documentation for more detailed information about managing the XR Plug-in lifecycle.
Optional features
The following table lists the optional features of the face subsystem. Each optional feature is defined by a Descriptor Property of the XRFace
Feature | Descriptor Property | Description |
---|---|---|
Face pose | supports |
Whether the subsystem can produce a Pose for each detected face. |
Face mesh vertices and indices | supports |
Whether the subsystem supports face meshes and can produce vertices and triangle indices that represent a face mesh. |
Face mesh UVs | supports |
Whether the subsystem supports texture coordinates for each face mesh. |
Face mesh normals | supports |
Whether the subsystem supports normals for each face mesh. |
Eye tracking | supports |
Whether the subsystem supports eye tracking for each detected face. |
Optional feature platform support
The following table lists whether certain XR plug-in providers support each optional feature:
Feature | ARCore | ARKit | Android XR |
---|---|---|---|
Face pose | Yes | Yes | |
Face mesh vertices and indices | Yes | Yes | |
Face mesh UVs | Yes | Yes | |
Face mesh normals | Yes | ||
Eye tracking | Yes | Yes |
Check for optional feature support
Your app can check at runtime whether a face tracking provider supports any optional features on the user's device. The XRFace
Refer to the following example code to learn how to check for optional feature support:
void CheckForOptionalFeatureSupport()
{
// This is inefficient. You should re-use a saved reference instead.
var manager = Object.FindAnyObjectByType<ARFaceManager>();
// Use manager.descriptor to determine which optional features
// are supported on the device. For example:
if (manager.descriptor.supportsFacePose)
{
// Face pose is supported.
}
}
Apple and ARKit are trademarks of Apple Inc., registered in the U.S. and other countries and regions.