ARKit face UV Unwrap

Hi,

I have been trying for the past few days to find a solution to texturing the ARKit face mesh that gets generated at run time.

The problem is, this face mesh gets generated at runtime and has no UV’s, I’ve been trying to learn how UV’s are generated, and kind of figured out how to set up UV’s at runtime for simple objects like planes and cubes but I can’t seem to crack the egg for the face mesh, nothing I do or find on the internet is working.

Please help and let me know if you have / can think of a solution.

Regards and thanks in advance!

What I found is, the face is actually unwrapped, but the UV’s are outside the texture bounds for some reason, does anyone know how I can move/arrange the UV’s into the texture bounds during runtime? Here is a photo showing how the face uvs look once the arkkit face is generated.

Figured it out with this code here.

            float xOffset = 0.0f;
            float yOffset = 1.0f;

       
            Vector2[] uvs = new Vector2[TargetMesh.vertices.Length];
            uvs = TargetMesh.uv;

            for (int i = 0; i < uvs.Length; i++)
            {
                uvs[i] = new Vector2(uvs[i].x + xOffset, uvs[i].y + yOffset);
            }

I hope it helps someone!