This system is for animating the face of an avatar. It's convenient for VTuber or creating animation with your avatar. This system cooperates with iYi FaceTracker on iOS.
First of all, you need to build and install iYi FaceTracker into your iPhone. It sends the tracked face data to your computer through a network (UDP). Then the Unity application made with this repository receives the data. Finally, you can animate an avatar using the tracked data.
- Prepare an avatar with BlendShape named values in
ARKitBlendShapeLocation
AvatarAnimatorclass changes values having the same name ofARKitBlendShapeLocationand the BlendShapeARKitBlendShapeLocationis a list of keys of the data from ARKit
- Add
IyiServeron a GameObject - Attach
AvatarAnimatoron a GamaObject (note: this class is a sample. I recommend to write your new class or modify the class because it is created from my personal dirty class) - Set meshes with BlendShape to
Blend Shapes, head bones of your avatar toHead Bones, the eye bones toLeft EyeandRight Eye - Run iYi FaceTracker on your iPhone
- Run the Unity project on your computer
It receives data from iYi FaceTracker.
And the parsed data is in IyiServer.faceData.
For example, the Update() method in your class might access like below.
var eyeBlinkLeft = GetComponent<IyiServer>().faceData.data[EyeBlinkLeft];