Skip to content

AdjustableGain

Guribo edited this page Jul 5, 2026 · 3 revisions

AdjustableGain

Example script (Runtime/Examples/) — not a core component. See Example Prefabs for usage.

Synced UI slider controlling voice gain on multiple PlayerAudioOverrides. Optionally restricts control to whitelisted players.

Important Limitation

This component requires manual setup. It cannot find overrides automatically — you must drag the PlayerAudioOverride components you want to control into the ControlledOverrides array.

Setup

  1. Add to a GameObject with a Unity UI Slider
  2. Assign the Slider reference
  3. Assign one or more PlayerAudioOverride components to ControlledOverrides
  4. Optionally assign a PlayerBlackList to restrict who can adjust the slider

Settings

Setting Type Default Description
Slider Slider (required) Unity UI slider bound to this control
ControlledOverrides PlayerAudioOverride[] (required) All overrides whose VoiceGain this slider controls
PlayersAllowedToControl PlayerBlackList (optional) If set, only these players may adjust
Gain float 15f Current gain value (synced across network)

Behavior

  • Slider value changes are synced via UdonSynced fields
  • Any player moving the slider takes ownership and broadcasts the new value
  • All players receive the synced value and apply it to their PlayerAudioOverride instances
  • If PlayersAllowedToControl is set, non-whitelisted players cannot change the value

Important Limitations

  • Requires a Slider component on the same GameObject or assigned via Inspector
  • The slider value range should match VRChat's gain range (0–24)
  • Multiple sliders can exist in the scene for independent controls
  • Only one player controls the gain at a time (ownership transfers on interaction)

See Also

Clone this wiki locally