Blog: Game Audio Scripting With Unity - Part 1

US Game audio development platform revealed      03/03/14

Getting Started

Let's start by importing a couple sounds: a music piece and a sound effect. Drag a few WAV files into the Assets pane at the bottom of the UI (or right click in the pane and choose "Import New Asset".)

Observe the default values shown in the properties Inspector:

There are a few things we can adjust here, but for now the only one we'll be looking at is the "3D sound" setting. This determines whether the sound is a 3D sound or a 2D sound.

  • 2D sound: this is what you'd be most used to from working with in a DAW--a sound that can be panned left and right, or raised or lowered in velocity. 2D sounds play at the same velocity and panning regardless of where they're played relative to the Audio Listener, therefore they're best suited to UI sounds or music.
  • 3D sound: conversely, 3D sounds have a sense of space. So in addition to be panned left or right they can be panned "back and forward" or "up and down". The engine takes care of all of this by looking at the position of the Audio Source in 3D space relative to the position of the Audio Listener.

In the example above I've imported music, so I'm going to uncheck the 3D sound checkbox and click the Apply button. Let's also import a sound effect but leave the 3D sound checkbox checked.

You should now have two audio assets:

Try dragging them both into the Hierarchy and watch what happens:


Send us your News: If you have a story or product you'd like us to cover - email news@sonicstate.com or use our contact form or join our Discord and post in #cool-finds


Get the latest headlines, offers and more in our amazing sonicstate newsletter - delivered to your in box every week
More From: UNITY
Even more news...


 

Get Our Newsletter


More...

Eventide H910 and more


5 MINUTES WITH ODD-1 Granular Instrument 

Multiple engines of granular joy


Broke Beats pt2 - A £30 DAW & Microcomputer 

M5Stack Cardputer ADV is an ESP32 S3-Powered Wonder


Sega Genesis/Mega Drive Sounds on the Carbon 8 

Creating Twangy Sega Tones on Modal's Synth


Presentation: Sonible Smart Chain Mix Plug-in 

Balance and process multi-track sessions


UDO DMNO ON - Desktop DMNO System 

Desktop DMNO and expanders...