docs.unity3d.com
    Show / Hide Table of Contents

    AR face manager

    The face manager is a type of trackable manager.

    AR face manager

    The face manager creates GameObjects for each face detected in the environment. The system only detects human faces.

    In some implementations, face tracking requires a different camera (for example, front-facing vs rear-facing) and might be incompatible with other features, such as plane or image tracking. Consider disabling other AR managers which manage trackables. These include:

    • Plane tracking
    • Image tracking
    • Object tracking
    • Environment probes

    Responding to faces

    Faces can be added, updated, and removed. Once per frame, if the application detects a face, the AR face manager invokes the facesChanged event. This events contains three Lists of faces that have been added, updated, and removed since the last frame.

    When a face is detected, the AR face manager instantiates the Face Prefab to represent the face. The Face Prefab can be left null, but the face manager ensures the instantiated GameObject has an ARFace component on it. The ARFace component only contains data about the detected face.

    Visualizing faces

    The face provider might provide a mesh that represents the face. The ARFace component exposes vertices, normals, indices, and uvs (texture coordinates). Some or all of these can be available.

    The ARFaceMeshVisualizer component generates a UnityEngine.Mesh and updates the MeshFilter on the same GameObject based on the data that the ARFace provides.

    Check the face subsystem's SubsystemDescriptor (ARFaceManager.descriptor) for provider-specific features.

    In This Article
    • Responding to faces
    • Visualizing faces
    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