Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Playing a sound#

Use a Play Instruction to choose an audio resource, configure playback, and place the sound in the scene. All five Play Instructions share these fields, with different defaults for each channel.

Play Sound Effect

Starting#

Field Controls
Audio The Audio Resource to play.
Save ID A String to store the sound's ID in. None, the default, discards it.
Settings Where the playback settings come from: Default, Preset, or Custom.

Audio is a Signal, so it can resolve a direct clip, variable, Random Audio Resource, or component value. A footstep Event can therefore select from six clips without branching.

Because the field takes an Audio Resource rather than an Audio Clip, Unity's own Audio Random Container works here too, with its weighting and pitch randomization intact.

Settings#

Settings decides which set of playback values a sound uses:

Option Reads its values from
Default The channel's entry under Channels in the Settings window's Audio section.
Preset An Audio Preset asset, shared by every Instruction that references it.
Custom Fields stored on this Instruction only.

New Play Instructions start on Default. When you change a channel's entry in the Settings window, every Play Instruction on that channel still using Default plays with the new values.

Use Preset when a group of sounds needs the same settings and they differ from the channel defaults, such as every creature footstep in a level. If the Preset field doesn't resolve to an asset, the Instruction falls back to the channel defaults. Audio Preset assets come from the separate Audio Presets package, which adds Create → Visual Script → Audio Preset.

Custom shows the fields inline. The rest of this page describes them; a channel entry in the Settings window and an Audio Preset asset contain the same fields.

Loop and fade in#

Field Controls
Loop None plays once, Loop plays until stopped.
Transition Seconds to fade in. 0 starts at full volume.

Audio settings#

Field Controls
Time Which clock this sound follows — Game Time, Real Time or From Source.
Priority Which sounds Unity virtualizes when it reaches its voice limit. 0 is the most important, 256 the least, 128 the default.
Volume This sound's own level, before the channel and Master are applied.
Pitch Playback speed and pitch together. 1 uses the recording's original speed and pitch.
Stereo Pan -1 full left, 0 center, 1 full right. Only meaningful on a 2D sound.
Spatial Blend 0 is 2D and unaffected by the listener's position. 1 is 3D and positioned in the world.
Reverb Zone Mix How much of the sound is sent to any Reverb Zones it passes through.

How Time affects playback#

Time affects both the fade in and the sound's pitch. The Audio Manager multiplies pitch by the selected clock's time scale, so this field also controls the sound's response to slow motion. Fade outs started by a Stop Instruction always run in real time.

Clock During slow motion During a pause
Game Time Drops in pitch with the game clock. Becomes silent at a time scale of 0.
Real Time Unaffected. Keeps playing.

Sound effects, ambient, and voice default to Game Time, while music and UI default to Real Time. A gunshot then stretches during bullet time, while the score and pause-menu sounds continue normally.

From Source follows the selected game object's clock, which is the Event's Source unless you change it. A sound belonging to an enemy in a stasis field then slows with that enemy rather than with the game. See Time & tweens.

A paused game silences its Game Time audio

A time scale of 0 multiplies the pitch by 0, which produces silence rather than a pause. The sound continues running and holding its source, then resumes mid-clip when time starts again. Anything that must be heard while the game is frozen belongs on Real Time.

Stereo settings#

Unity applies these fields when Spatial Blend is above 0. They don't affect a 2D sound.

Field Controls
Volume Rolloff Logarithmic falls off the way sound does in air. Linear falls off evenly and reaches exactly zero at the max distance.
Min Distance Inside this radius the sound is at full volume. Default 1.
Max Distance Beyond this the sound stops getting quieter — with Logarithmic it stays faint rather than silent. Default 500.
Doppler Level How much a moving source shifts pitch. Default 0.
Spread Constant keeps one width at every distance. By Distance widens the sound when the listener is close.
Spread value How wide the source is across the speakers, in degrees. 0 is a point.
Omni Radius With By Distance, the radius inside which the sound spreads to 180 degrees. Default 2.
Blend Distance With By Distance, how far past Omni Radius the width takes to narrow to the Spread value. Default 3.

Use By Distance for close-up sounds, such as a fire the player stands next to or a voice from the player's own character. Inside Omni Radius, the sound spreads across the speakers instead of coming from one point, so it doesn't pan hard to one side as the camera turns.

Use Min Distance to set the radius within which the sound stays at full volume. Increasing it from 1 to 15 extends that area without increasing the volume near the source. Raising Volume instead also makes the sound louder up close.

Logarithmic rolloff never reaches zero

Under Logarithmic rolloff, a distant sound remains quiet rather than silent, and each quiet sound still uses a voice. Use Linear when a sound should reach silence at its maximum distance.

Location#

Location controls where the sound is emitted:

Mode Plays at
None The Audio Manager's own position, which is the world origin. Use for 2D sounds.
Target The Has Target game object, followed every frame.
Position A fixed point in the world, taken once when the sound starts. Defaults to Source Position.
Transform A game object's transform, followed every frame. Defaults to the Source.

Position and Transform are the difference between a sound that plays where something happened and a sound that travels with it. An impact stays where it landed; an engine follows the car.

By default, Ambient and Voice start on Target, Sound Effect on Position, and Music and UI on None.

Sound effects play at the Source by default

Play Sound Effect starts as a 3D sound with Location set to Position, and that position reads Source Position. The sound plays where the Event's Source is when it starts, which is the Event's own game object for most Triggers.

If the Event lives on a manager object, the sound plays at the manager rather than at the impact. Point the position at the object that caused the sound, or change Location to Transform.

Has Target#

Has Target associates the sound with a game object without parenting the Audio Source. When enabled, it uses the Source by default. Stop Audio on Game Object and Is Playing on Game Object can then find the sound, and Location can follow the target.

This lets an Event stop a character's voice without tracking the resource used by the current line.

A destroyed target doesn't stop its sound

The sound isn't attached to the object, so destroying the object leaves the sound playing. With Location set to Target, the transform it followed is gone, so the sound stops moving and continues from the target's last position.

A looping ambient sound can therefore keep playing where its object used to be. Stop the sound before you destroy its target: Stop Audio on Game Object with a short fade, then destroy.

Where to go next#

  • Stopping a sound — select and fade sounds that are already playing.
  • Channels — see how channel and Master volumes affect final loudness.
  • Time & tweens — understand the clocks selected by Time.
  • Signals — configure the Signal fields used by Play Instructions.
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.