Search Unity

  1. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Help Wanted [UNITY ARFOUNDATION + IOS 14.2] FACE MESH IS DETECTED BUT NO EYE DATA/TRANSFORM IS HELP

Discussion in 'AR' started by thomasrafty, Sep 1, 2021.

  1. thomasrafty

    thomasrafty

    Joined:
    May 28, 2020
    Posts:
    4
    Hey guys I bought a macbook air to get my eye rotation but for some reason its not picking up my eyes. When I try to call ARFace.leftEye it just returns null even when a face mesh is detected. How do I turn on Eye tracking? Im using Unity 2020.3.16f1
    I've been following tutorials such as this one and by all means it shows its possible to receive the eye transform at least in the past. Has this been depreciated or something?
     
  2. KirillKuzyk

    KirillKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    754
    I looked at the face tracking descriptor of ARKitFaceSubsystem:
    Code (CSharp):
    1. [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
    2. static void RegisterDescriptor()
    3. {
    4.     if (!UnityARKit_FaceProvider_IsSupported())
    5.         return;
    6.  
    7.     UnityARKit_FaceProvider_OnRegisterDescriptor();
    8.  
    9.     var descriptorParams = new FaceSubsystemParams
    10.     {
    11.         supportsFacePose = true,
    12.         supportsFaceMeshVerticesAndIndices = true,
    13.         supportsFaceMeshUVs = true,
    14.         supportsEyeTracking = UnityARKit_FaceProvider_IsEyeTrackingSupported(),
    15.         id = "ARKit-Face",
    16.         providerType = typeof(ARKitFaceSubsystem.ARKitProvider),
    17.         subsystemTypeOverride = typeof(ARKitFaceSubsystem)
    18.     };
    19.  
    20.     XRFaceSubsystemDescriptor.Create(descriptorParams);
    21. }
    As we see from the code above, the supportsEyeTracking is determined at runtime, so it can be false under some conditions. Unfortunately, UnityARKit_FaceProvider_IsEyeTrackingSupported is a call to a native library, so it's not possible to see why the code may return false. A comment from the AR Foundation team would be very helpful.

    ARKit's documentation also is not helpful, the only documentation I found on face tracking support is this one and it mentions eye tracking only in the context of iOS12:
    @thomasrafty Could you please tell what iOS device do you have and its OS version?
     
  3. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,699
unityunity