# Jaw Bone Lip Sync

### Overview

The **Jaw Bone Target** (CrystalLipSyncJawBoneTarge&#x74;**)** component is a lightweight alternative to the standard `CrystalLipSyncBlendshapeTarget`. Instead of driving SkinnedMeshRenderer blendshapes, it **rotates a jaw bone** to open and close the mouth.

<figure><img src="https://1935854846-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuciaAIoc6XDGWTpXdIP7%2Fuploads%2FVkCvlGcWVCZAkEzCug0N%2Fimage.png?alt=media&#x26;token=d9a973cd-7fd0-4237-9e37-46a608df46f7" alt=""><figcaption></figcaption></figure>

This is ideal for characters that have no blendshapes at all ... the jaw simply opens wider for loud vowels and closes during silence, giving a convincing "talking" appearance at minimal cost.

{% hint style="info" %}
The Jaw Bone Target reads from the same `CrystalLipSyncController` as the Blendshape Target. All audio analysis, viseme classification, and smoothing features work identically ... only the output method differs.
{% endhint %}

***

### When to use it

| Scenario                                                | Use Jaw Bone Target?                                                        |
| ------------------------------------------------------- | --------------------------------------------------------------------------- |
| **Low-poly characters** (mobile, retro, voxel)          | **Yes** ... no blendshapes needed                                           |
| **Stylised / comic characters** with simple geometry    | **Yes** ... one rotating bone is enough                                     |
| **Procedurally generated characters** with a rigged jaw | **Yes** ... assign the bone at runtime                                      |
| **VR hands / avatars** with a jaw bone but no face mesh | **Yes**                                                                     |
| **Robots / puppets** with a hinged jaw                  | **Yes** ... perfect mechanical open/close                                   |
| **Realistic characters** with full face blendshapes     | **No** ... use `CrystalLipSyncBlendshapeTarget` instead                     |
| **Characters with ARKit / FACS blendshapes**            | **No** ... blendshape mapping gives far better results                      |
| **Characters needing distinct vowel/consonant shapes**  | **No** ... jaw-only cannot distinguish lip rounding, bilabial closure, etc. |

{% hint style="warning" %}
Jaw Bone lip sync produces **open/close only**. It cannot distinguish between different mouth shapes (e.g., "AH" vs "OO" vs "EE" all produce the same jaw-open). For characters where the camera is close to the face, blendshape lip sync will always look significantly better.
{% endhint %}

***

### Setup

#### Option A ... Setup Wizard (recommended)

1. Open **Tools → Crystal LipSync → Setup Wizard**
2. Drag your character into the **Character GameObject** field
3. If no viseme blendshapes are found, the wizard automatically suggests **Jaw Bone** mode
4. You can also manually switch the **Lip Sync Target** dropdown to `JawBone`
5. Click **Setup Character**

The wizard will:

* Add an `AudioSource` and `CrystalLipSyncController` (as usual)
* Add a `CrystalLipSyncJawBoneTarget` instead of a `BlendshapeTarget`
* Auto-detect the jaw bone in the hierarchy

#### Option B ... Manual setup

1. Ensure your character has a `CrystalLipSyncController` with an AudioSource assigned
2. Add the **CrystalLipSyncJawBoneTarget** component (Add Component → CrystalLipSync → Jaw Bone Target)
3. Assign the **Controller** reference
4. Assign the **Jaw Bone** transform (or click **Auto-Detect Jaw Bone**)
5. Adjust the **Axis**, **Max Angle**, and **Invert Direction** to match your rig

***

### Settings

| Setting               | Default  | Description                                                                                                  |
| --------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| **Controller**        | ...      | The `CrystalLipSyncController` that provides viseme weights and volume data.                                 |
| **Jaw Bone**          | ...      | The Transform to rotate. Typically the first child of the head bone (named `Jaw`, `Chin`, `Mandible`, etc.). |
| **Axis**              | `X`      | Which local axis the jaw rotates on. Most humanoid rigs use X or Z.                                          |
| **Max Angle**         | `15°`    | Maximum rotation when the jaw is fully open. Typical range: 10°...25°.                                       |
| **Invert Direction**  | `false`  | Flip the rotation direction if the jaw opens the wrong way.                                                  |
| **Drive Mode**        | `Viseme` | What drives the jaw opening ... see below.                                                                   |
| **Smoothing Speed**   | `20`     | How quickly the jaw responds to changes. Higher = snappier.                                                  |
| **Intensity**         | `1.0`    | Global multiplier for jaw opening (0...1).                                                                   |
| **Volume Multiplier** | `40`     | Scales raw audio RMS (which is very small) up to a usable range. Only used in Volume or Combined mode.       |

***

### Drive Modes

| Mode         | Source                        | Quality  | Use case                                                                     |
| ------------ | ----------------------------- | -------- | ---------------------------------------------------------------------------- |
| **Viseme**   | AA (open vowel) viseme weight | Best     | Default ... uses the full FFT analysis pipeline to detect open-mouth sounds  |
| **Volume**   | Raw audio RMS amplitude       | Basic    | Simplest open/close; every sound opens the jaw proportionally to loudness    |
| **Combined** | Max of Viseme and Volume      | Balanced | Uses whichever signal is stronger; catches both speech and non-speech sounds |

{% hint style="info" %}
**Viseme mode** is recommended for speech. It only opens the jaw for actual open-vowel sounds (AA), so the mouth stays closed for consonants like "M", "B", "S". **Volume mode** opens the jaw for any loud sound, including music, footsteps, or environmental noise playing through the same AudioSource.
{% endhint %}

***

### Auto-Detection

The **Auto-Detect Jaw Bone** button (and the Setup Wizard) searches the character's bone hierarchy for transforms with names containing:

* `jaw`, `chin`, `mandible`
* `mouth_bone`, `bn_jaw`, `bip_jaw`, `def_jaw`, `bone_jaw`

It prefers bones with `lower` or `bot` in the name and avoids bones named `upper` or `lip`.

If auto-detection fails, assign the jaw bone manually by dragging it from the hierarchy.

***

### Works with Text Lip Sync

The Jaw Bone Target also works with `CrystalTextLipSync` for text-driven lip sync (no audio needed). When `CrystalTextLipSync` writes viseme weights into the controller, the Jaw Bone Target reads the AA weight and opens the jaw accordingly.

This means the Jaw Bone Target works with:

* **Audio lip sync** (real-time FFT from AudioSource)
* **Text lip sync** (from CrystalTextLipSync)
* **Microphone lip sync** (from CrystalMicrophoneLipSync)
* **Any integration** (Game Creator 2, PixelCrushers Dialogue System, etc.)

***

### Editor Preview

The custom inspector includes:

* **Auto-Detect Jaw Bone** button ... finds the jaw bone in the hierarchy
* **Live Debug View** (Play Mode) ... shows a progress bar of the current jaw opening
* **Test Pose slider** (Edit Mode) ... preview the jaw rotation range without entering Play Mode

***

### Troubleshooting

#### Jaw doesn't move

1. Check that **Controller** and **Jaw Bone** are assigned in the inspector
2. Verify the controller's **AudioSource** has audio playing
3. Try **Volume** drive mode to confirm the bone rotates at all
4. Check that **Max Angle** is high enough to be visible (try 20°)

#### Jaw opens in the wrong direction

* Toggle **Invert Direction** in the inspector
* If still wrong, try a different **Axis** (X / Y / Z)

#### Jaw snaps open/closed too fast

* Reduce **Smoothing Speed** (try 10...15)

#### Jaw barely opens

* Increase **Max Angle** (try 20...30°)
* Increase **Intensity** (try 1.0)
* If using Volume mode, increase **Volume Multiplier**

#### Jaw opens for non-speech sounds

* Switch from **Volume** to **Viseme** drive mode ... it only responds to detected open-vowel sounds

***

### FAQ

{% hint style="info" %}
**Q: Can I use both Jaw Bone Target and Blendshape Target on the same character?**\
A: Technically yes, but it rarely makes sense. If your character has blendshapes, use the Blendshape Target ... it produces far better results. The Jaw Bone Target is designed for characters *without* blendshapes.
{% endhint %}

{% hint style="info" %}
**Q: Does this work with Humanoid rigs?**\
A: Yes. The component runs in `LateUpdate` after the Animator, so it overrides the Animator's jaw rotation correctly. Just make sure the jaw bone isn't locked by an Animation Override layer.
{% endhint %}

{% hint style="info" %}
**Q: What if my character has no jaw bone at all?**\
A: You can use any transform as the "jaw bone" ... for example, the lower half of a split-face mesh, a puppet's lower jaw piece, or any hinged object. The component just rotates whatever transform you assign.
{% endhint %}

{% hint style="info" %}
**Q: Is there any performance difference?**\
A: The Jaw Bone Target is slightly cheaper than the Blendshape Target ... it's a single `Quaternion.Euler` + assignment vs iterating 15 blendshape weights. Both are negligible.
{% endhint %}
