Week Eleven
- Robert Allen
- Dec 10, 2023
- 4 min read
Last week, i began to test audio within Wwise and given how close it was to the deadline now i had to do as much as possible withing this final week. So i started off by implementing the music as this would be the easiest thing to do.
Before i began implementing the sounds, i decided to move where the Wwise project was located within the unity project.

I decided to do this because when i had originally implemented Wwise into the project, it was placed into a random folder into the project making it quite hard to find. I decided to instead move it into a folder i named Wwise which meant who ever were to look at the project would be able to easily found it.

The first bit of music i decided to add was the main menu theme as this would be the first thing the player hears when they launch the game. When i began implementing it into unity, i first attempted it on a brand new object as i would be able to name it something sensible such as “Music_Theme”. However, when i went to test it, i ran into multiple errors where it stated id failed to find the game object’s ID. So i attempted it a few more times and had no success. So, i decided to give it a go on the white crystal as it was at the top of the hierarchy meaning it would be easy to find if i had to go back to it later on. The first thing you need to do to get sound working in unity is to generate the soundbanks from Wwise. Soundbanks are important as they carry the data of all the sounds and events that you have created. To generate them into unity, you’ve got to add the component named “AkBank” on a object. I decided to apply it to the same noice that would generate the music so it was easy to find. Once you have added it, you click on name and it will show all the soundbanks you have made then you select the one you want. With my soundbank now generated in the scene, i now had to trigger the music event itself. To do this, i added the “AkEvent” component onto the crystal then found the event under the name tab.
When i pressed play on the AkEvent component, the music played meaning that unity had sucessfully found the event. To make sure it worked, i pressed play on the project and once the main menu appeared the music began to play. With it working as it should i decided to move onto the next piece of music.

The first level of the game is set in the slums so i decided to implement the slums theme next. Just like the menu theme, when i tried to add the music to a object of my own i just recieved errors. So i decided to again add it to a pre exisiting object this time a bush. The process of adding music to this scene is the same where i first generated the soundbank named “MusicSlums”. I then applied the AkEvent which would trigger the music event named “Slums_Theme”. Finally when i pressed play on both the Event tab and to play the game, the music worked fine. So, i then moved onto the next scene where music would begin.

Whilst exploring the slums, the player will encounter the warden who captures the player and brings them to the next area of the game, the dungeon. Just like the two previous areas, implementing the music was quite easy and this time it allowed me to apply the music to an object that i created. Once i had generated both the soundbank and event into the object it worked. The dungeon is a small area and the player wont be spending too much time here as all they have to do is find the key then use it to unlock the door. When they open the door, the player gains access to the main area of the game, the castle. At this point, the music would transition into playing the castle music. However, this is where i began to have issues with unity.

To trigger the music transition, i started of by creating a empty game object named “Castle Music Trigger” which i then placed on the otherside of the door. Once it was in place i added a box collider to it which is the green outline you see. Once reshaped the collider to be the same size of the door, i then added the following components to it.

The AkEvent is connected to the Ak TriggerCollisionEnter script meaning once the player collides with the green outline, it would then trigger the event which should begin playing the castle music playlist. However, when i pressed play i ran into these errors.

I attempted to fix this for several hours and i hadn’t made progress so i asked for help from various people. However, when i attempted to the solutions they provided i still got the same results. So i decided to move on and work on the little sounds effects i could.

Unfortunately, the lack of time meant that the programmers were unable to implement the required code for any player or enemy sounds to be triggered. This meant that the only other sound i could attempt to add to the project was enviroment sounds so i decided to try get sound playing from the torches. For this i first added the torch sound to the dungeon music soundbank as it was already generated. Meaning that unity wouldn’t have any issues trying to found the bank. I then added the AkAmbient component to the first torch then set it to trigger the event named “PlayTorches”. However, once i pressed play i faced the same errors from the castle music. I attempted to resolve it using the solutions provided for the music but they didn’t improve anything. In the end, i was only able to get the main menu, slums and dungeon music to work as they should and with there being very little time to fix this i had to submit what i had onto github so the final build at least had some audio instead of silence.



