-
Notifications
You must be signed in to change notification settings - Fork 8
AudioObstacle
Guribo edited this page Jul 5, 2026
·
5 revisions
Packages/tlp.udonvoiceutils/Runtime/Core/PlayerOcclusion/AudioObstacle.cs
Defines per-obstacle occlusion properties for environment colliders.
Attach to environment colliders to control how much sound passes through. When a raycast hits this collider during occlusion checks, ObstacleClarity is used instead of the global environment clarity.
| Field | Default | Range | Description |
|---|---|---|---|
ObstacleClarity |
1.0 |
0-1 | 0 = fully blocks sound, 1 = fully transparent (no effect) |
- Add
AudioObstaclecomponent to a collider GameObject - Set
ObstacleClarity(0 = wall, 0.5 = muffled, 1 = transparent) - Ensure the collider is on the Environment layer
- Walls need collision surface on both sides to work in both directions
| Obstacle | Clarity | Effect |
|---|---|---|
| Solid wall | 0.0 |
Full muffling |
| Thin curtain | 0.7 |
Slight muffling |
| Open doorway | 1.0 |
No effect |
The DefaultPlayerOcclusion strategy checks for AudioObstacle on each raycast hit:
- Layer mask filters GameObjects first
- On hit,
GetComponent<AudioObstacle>()is called - If found, uses
ObstacleClarity - If not found, uses global
environmentClarityfallback
The playerOcclusionMask field on PlayerAudioController determines which layers are checked by the raycast:
- If the UI layer is in the mask, player capsules are detected (enables player occlusion)
- If UI layer is not in the mask, only environment obstacles are detected
| Strategy | Behavior |
|---|---|
| DefaultPlayerOcclusion | Raycast-based, supports AudioObstacle per-obstacle clarity |
| NullPlayerOcclusion | No occlusion (passthrough) |
- Occlusion — how occlusion works
- How to Set Up Occlusion — step-by-step setup
- DefaultPlayerOcclusion — the raycast strategy
- Troubleshooting — common issues
- 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