-
Notifications
You must be signed in to change notification settings - Fork 8
DefaultPlayerOcclusion
Guribo edited this page Jul 11, 2026
·
4 revisions
Packages/tlp.udonvoiceutils/Runtime/Core/PlayerAudio/PlayerOcclusion/DefaultPlayerOcclusion.cs
Raycast-based occlusion strategy — the default implementation.
Casts rays from the listener's head toward the emitter's head. Hits along the ray determine how much audio is muffled.
| Hits | Meaning | Result |
|---|---|---|
| 0 | Clear line of sight | Full clarity (1.0) |
| 1 | One obstacle hit | Check distance — if hit is more than 1m from listener, full clarity; otherwise apply obstacle/player clarity |
| 2 | Two obstacles hit | If both are players → player clarity; otherwise → environment hit clarity |
- Environment dominates: when any environment hit exists, player occlusion is ignored
- Player occlusion: only used when both hits are players (no environment between them)
-
AudioObstacle: if present on a hit collider, uses its
ObstacleClarityinstead of global fallback
- Buffer size: 2 hits
- Mask:
playerOcclusionMaskfrom the activePlayerAudioOverrideorPlayerAudioConfigurationModel - Player hits detected by null transform (UdonSharp filters player objects)
- Player occlusion requires the UI layer in the mask — if removed, only environment obstacles affect clarity
Extends PlayerOcclusionStrategy — see PlayerOcclusionStrategy for the abstract interface.
- Occlusion — how occlusion works
- AudioObstacle — per-obstacle clarity component
- NullPlayerOcclusion — no occlusion passthrough
- Architecture
- Occlusion
- Voice Directionality
- Height Scaling
- Audio Processing Pipeline
- Private Voice Channels
- WorldAudio Subsystem
- WorldAudio Limitations
- Set Up Occlusion
- Set Up Voice Channels
- Set Up Reverb
- Set Up Height Scaling
- Set Up Voice Directionality
- Set Up Microphone
- Set Up WorldAudio Emitters
- Enable Debug Mode
- Tutorial #1: Custom Voice Override Zone
- Tutorial #2: Private Voice Channels
- Tutorial #3: Setting Up World Audio
- PlayerAudioController
- PlayerAudioOverride
- PlayerAudioOverrideList
- PlayerAudioView
- PlayerAudioConfigurationModel
- SyncedPlayerAudioConfigurationModel
- VoiceUtils
- IgnoredPlayers
- AudioObstacle
- DefaultPlayerOcclusion
- NullPlayerOcclusion
- PlayerOcclusionStrategy
- Privacy Channel Reference
- AdjustableGain
- DynamicPrivacy
- PickupMicrophone — MVC microphone system with MicModel/MicController/MicView
- VoiceOverrideTriggerZone
- VoiceOverrideRoom