Here’s a brief look at the setup phase of Wwise and Unity integration. More detail on working with Wwise inside of Unity to come in later weeks!
This guide assumes you already have Unity and Wwise installed, and at least a bit of experience in each.
1. Getting Started:
a. Create and save a new Wwise project and a new Unity project, or use a current project you would like to integrate. Be safe, make sure to create a backup of your projects before attempting integration!
b. Move your Wwise project directory into the top level of your Unity project directory. This isn’t essential, but helps simplify project structure later.
c. Download the Wwise Unity integration package from https://www.audiokinetic.com/download/.
d. Open your Unity project and from the menu, select Assets, Import Package, Custom Package. Select the file WwiseUnityIntegration_etc.unitypackage that you just downloaded. In the next window, click Import to bring in the entire data structure. Note that you are creating two folders inside of Assets called Wwise and StreamingAssets.
2. Linking Wwise to your Unity Project
Immediately after the import, you’ll get a Wwise setup window. This is where you need to specify the path of your Wwise project, and the location where your soundbanks will reside inside the StreamingAssets folder.
– You can get back to this window at any time via Edit, Wwise Settings in your Unity menu!
A crucial point for later – When you build your Unity project into a game, it needs to see your soundbanks in the StreamingAssets folder to hear audio. (Usually under StreamingAssets/Audio/GeneratedSoundBanks/“platform”) HOWEVER, when you are working inside of Unity, the audio you hear during playtesting may be pulled from the GeneratedSoundBanks folder inside of your linked Wwise project, which is a different directory. This simply means that before building a final game package, you may need to copy or generate your soundbanks into the StreamingAssets location.
3. Components, Components Everywhere
Wwise integrates with Unity via Components. Everything that exists in your Unity scene Hierarchy is a GameObject, and GameObjects have Components attached. Components can be behavioral attachments that define how an object is treated in your game engine, or custom instructions contained in scripts.
Wwise requires a few components to be initialized just to function inside of your scene. It will attempt to place some of these automatically when you import the integration package, but it’s important to know what they are to fix any problems that may arise. These initial components will be placed onto a new game object called Wwise_Global, which is essentially just an empty placeholder that hosts the scripts.
A basic Wwise_Global object should have the following –
Ak Initializer – starts Wwise code in game!
Ak Terminator – stops Wwise code at end!
Ak Bank – loads a specified soundbank so that events and parameters from that bank can be called in your project.
It should be noted that AK Bank doesn’t have to live on this GameObject – if you had multiple banks that were loading and unloading during gameplay at specified times to manage system resources, then it is entirely reasonable that banks might need to exist on specialized objects.
You are now ready to start placing components on objects that call Wwise events to get sounds in game! In future rounds, we’ll get more detailed and cover specific examples for placing ambient sounds, triggers, custom event calls, and workflows that help streamline your process in working with Wwise and Unity.