Unity Tutorial 07 (Semester 2)
Image from the tutorial This week I did my final Ruby tutorial for the semester and I have to say it was a pretty good feeling. Up until this week my game has had no audio so this week I had to add some in. This week I learned about audio clips, audio listener and audio source. Audio clips are assets that you can import from an audio file such as MP3 and wav. Audio listener is a component that tells you where the listener is in the scene which is placed on the camera. Audio source is a component that allows you to play an audio clip where the GameObject is. The first thing I had to do was add in some background music. To do this I had to create a new GameObject called BackgroundMusic and add audio source to it. I then had to add in an audio clip called 2D MUSIC LOOP so that the music would play from the beginning to the end. I then had to add in the spatial blend slider and make it go all the way to 2D so that my music could be heard everywhere. I then had to add a one shot sound...