VoiceChatMouthController
A class in Root.Township, Alta.Networking.Voice.
Animates a player's mouth from their voice chat volume: sets the Speaking layer weight and picks random mouth shapes. Client only; turns itself on once linked to a player, never when headless.
- Listed in Networking and servers
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
VoiceChatMouthController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private Animator animator | The character dummy's animator. |
private PlayerController controller | The player controller this belongs to. |
private CharacterDummyPointer dummy | Pointer to the character dummy that holds the animator. |
private float lastChangeVolume | Volume level at the last mouth shape change. |
private float mouthChangeChance | Base chance per frame of a new mouth shape (default 0.2). |
private static readonly int MouthShapeID | Animator hash for the Mouth Shape parameter. |
private float normalizedVolumeShiftChange | Extra chance per unit of volume change since the last shape change. |
private int numberOfMouthShapes | How many mouth shapes to pick from. |
private Player player | The network player whose voice is read. |
private int speakingLayer | Index of the animator's Speaking layer. |
private AnimationCurve voiceModulator | Curve that turns voice energy into layer weight. |