docs.unity3d.com
    Show / Hide Table of Contents

    Face tracking

    For information about face tracking, see AR Foundation Face tracking.

    The ARCore face subsystem provides face tracking methods that allow access to "regions". Regions are specific to ARCore. ARCore provides access to the following regions that define features on a face:

    • Nose tip
    • Forehead left
    • Forehead right

    Each region has a Pose associated with it. To access face regions, obtain an instance of the ARCoreFaceSubsystem using the following script:

    XRFaceSubsystem faceSubsystem = ...
    #if UNITY_ANDROID
    var arcoreFaceSubsystem = faceSubsystem as ARCoreFaceSubsystem;
    if (arcoreFaceSubsystem != null)
    {
        var regionData = new NativeArray<ARCoreFaceRegionData>(0, Allocator.Temp);
        arcoreFaceSubsystem.GetRegionPoses(faceId, Allocator.Temp, ref regionData);
        using (regionData)
        {
            foreach (var data in regionData)
            {
                Debug.LogFormat("Region {0} is at {1}", data.region, data.pose);
            }
        }
    }
    #endif
    
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023