Configuring a new AR scene for face tracking
There are a few simple steps required to configure an AR Foundation-based scene for face tracking. Since we're going to do selfies, we'll set up the AR camera to use input from the front-facing camera. Then we'll add an AR Face Manager component to the AR Session Origin. If you want to use the Unity Onboarding UX animated graphic to prompt the user, you can adapt the ScanMode
script for that.
Let's get started!
Setting the AR camera for selfies
Use the following steps to set up the AR camera for selfies:
- In the Hierarchy, unfold the AR Session Origin game object and select its child Main Camera.
- In the Inspector, set AR Camera Manager | Facing Direction to User.
- We also need to set the AR Session tracking mode for rotation only. Select the AR Session game object in the Hierarchy.
- In the Inspector, set the AR Session | Tracking Mode to Rotation Only.
Next, we'll add the AR Face...