Everdevs Community
Published in

Everdevs Community

“Funslingers” Devblog #21 | Immersion Starts with Sound

Hey Devs!

Music and Sound is commonly left on the back-burner when making a game, but it’s actually just as important as your game’s art or code. And as the title suggests, immersion starts with sound. So to get our game feeling AND sounding right, let’s get started putting in some tunes!

We can start simple by adding sounds to our Main Menu!

The easiest thing to put in will be our background music!

So first thing we need is our AudioSource, I’ll do this by making a quick “Audio Manager” gameobject and then create a new gameobject inside it with our Audio Source component.

From here we can simply drag our Background Music file into the AudioClip, set it to Play On Awake and Loop and now we have background music!

Now, the next thing will be sound effects for our buttons! I want our buttons to play a cool ricochet sound when they are clicked, to make my interactive menu feel even better!

To do this we’ll need to add an AudioSource to our buttons, and play them through our script whenever they are pressed.

First thing we’ll do is add our AudioSource to our Title Button, this time we don’t want it to Play On Awake or Loop.

Then, in our button script, we’ll get reference to our AudioSource Component, and call the Play method to play our ricochet sound!

I also used Random.Range to slightly adjust the pitch each time it’s played to avoid it sounding repetitive.

I’m able to apply the exact same code to our Start and Exit buttons and with that we have finished all the Audio for our Main Menu!

In the next devblog we are gonna use what we’ve learned to bring sound to the rest of our game!

Game dev tutorials and news about Everdevs.

Recommended from Medium

How To Clone or Copy a List in Python

DanTDM Skin

Integrate Xamarin To Create Cross-platform Native Mobile Apps For Enterprises

Top 5 Reasons Leading Companies Choose a Cloud-Based Intranet

What is widening , truncation , promotion , and conversion between , the different C , arithmetic…

How to limit file size on upload to S3 using Java

3 different approaches to creating an icon library using SVGs

Tips for Attending your First RubyConf

Large outside blue bear sculpture peering into the glass of the front of the Denver convention center. There are trees and building in the background.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ethan Bristowe

Ethan Bristowe

Passionate self taught game developer excited to learn and share everything I can about game development!

More from Medium

Generic FIR Filter Using Floating-Point IP in Vivado

WebGL Optimization in Unity

Interacting with Image-Based Element — Appium

Unity Performance Optimization: Animation Module