Develop

Audio Trigger

Updated: Aug 27, 2026
Audio clips in Interaction SDK are triggered using the Audio Trigger component, which is set using Event Wrappers in the Inspector.

AudioTrigger

The Audio Trigger component should be placed on a GameObject alongside an Audio Source component. Events should be set to the AudioTrigger.PlayAudio() method.
AudioTrigger ships in the Interaction SDK samples, in the Oculus.Interaction.Samples assembly, under the Oculus.Interaction namespace. That assembly is auto-referenced. The Inspector wiring below, and any script outside a custom assembly definition, need no setup. A script inside its own assembly definition needs a reference to Oculus.Interaction.Samples.

Wire an Audio Trigger in the Inspector

  1. Add a child GameObject to your interactable object and name it Audio. This container keeps the audio separate from the interaction components.
  2. Add a child of Audio for the sound.
  3. Add an Audio Source component to that GameObject.
  4. Add an Audio Trigger component to the same GameObject.
  5. Fill Audio Clips with one or more clips. The component asserts at startup when the list is empty. That assert runs in the editor and in development builds.
  6. Leave Audio Source empty. AudioTrigger looks for an Audio Source on its own GameObject at startup. Adding the component does not add an Audio Source for you, so step 3 is required.
  7. Select the parent Audio GameObject and add a PointableUnityEventWrapper component. In the event slot you want, drag in the sound GameObject, then pick AudioTrigger and PlayAudio ().
Repeat steps 2 through 6 for each distinct sound. One AudioTrigger holds one set of clips, so a grab sound and a release sound need one instance each.
The result looks like this.
MyProp
└── Audio
    ├── PointableUnityEventWrapper
    │     When Select   -> GrabSound.AudioTrigger.PlayAudio ()
    │     When Unselect -> ReleaseSound.AudioTrigger.PlayAudio ()
    ├── GrabSound        AudioSource + AudioTrigger
    └── ReleaseSound     AudioSource + AudioTrigger
For the full walkthrough that plays a sound when the player grabs an object, see Play a sound when an object is grabbed. That page also lists which event slot to pick for grab, release, and distance-grab hover cues.

Properties

PropertyDescription
Audio Source
The Audio Source that plays the clip. Leave it empty to use the Audio Source on the same GameObject.
Audio Clips
A list of audio clips. The clip is chosen at random. With two or more clips, the pick never repeats the clip played immediately before it. A single-clip list plays that clip every time.
Volume
The default playback volume of the audio clip. Defaults to 0.7.
Volume Randomization
A random range of volumes at which to play the audio clip.
Pitch
The default pitch of the audio clip. Defaults to 1.
Pitch Randomization
A random range of pitches at which to play the audio clip.
Spatialize
Overrides the Spatialize property on the attached AudioSource. Enabled by default.
Loop
Overrides the Loop property on the attached AudioSource.
Chance To Play
The likelihood that the sample will play when called. Defaults to 100.
Play On Start
Indicates if the audio clip should play when Start() is called on this object.

Randomization

Volume Randomization and Pitch Randomization each hold a Use Random Range checkbox with Min and Max values. Enable Use Random Range to pick a fresh value between Min and Max on every call. The flat Volume or Pitch value is then ignored.
Min and Max both default to 0. Enabling Use Random Range without setting them yields a volume of 0, which is silence. Set the range in the same pass.
The sample props leave randomization off. They vary their sound through a multi-clip Audio Clips list instead.

What Audio Trigger overwrites

Each call to PlayAudio() that reaches playback writes Spatialize and Loop onto the attached Audio Source. It also writes a volume and a pitch, taking each from either the flat field or the random range. Values authored on the Audio Source itself are replaced, so configure playback on the Audio Trigger.
When Chance To Play is below 100 and the roll fails, the call returns early and writes nothing.
PlayAudio() is the only playback method on the component, and there is no matching stop method. To halt a looping clip, wire Stop on the Audio Source component.

Learn more

Design guidelines