Getting Immersive with Sound FX

Soundwave from transformers…see what I did here! >:\

Sound Plan

We have several places where we want to play sounds. Let’s see what sound clips we have first.

  1. Laser Sounds
  2. Explosion Sounds
  3. PowerUp Pickup Sounds

For the purpose of today’s article I’ll focus on the laser shot.

Assuming that you have your desired sound FX file chosen and imported into your assets folder in Unity.

On our Player in the hierarchy, select the player object and in the inspector. We’ll add an Audio Source component. Make sure to uncheck “Play On Awake”.

Then in our Player script we’ll create a variable for the AudioSource controller and a serialized field where we will drag our soundfile into from the asset folder to the inspector.

In our Player script in our start method we we’ll also check to make sure the Audio Source isn’t null.

Finally in our FireLaser() method we sinply call on the audioSource.play()

--

--

--

Unity Developer — Technology Leader — Making Unity Game Development Look Easy

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Setting Up a New M1 MacBook for Plugin Development for Atlassian Products

Samsara Dev Spotlight: Kavya Joshi

Weekly Devlog #6

InfraHack 1. 0 Case Study

Friday Development Updates: Part 6

Test your spark application using JUnit

Adobe Experience Manager Exploitation

Spring Boot — AWS

AWS Console

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
Games Woods

Games Woods

Unity Developer — Technology Leader — Making Unity Game Development Look Easy

More from Medium

Should you hold a $VVS (Very Very Simple) bag in 2022?

How School Senator and Student Emma Bergren is Facing COVID-19

How You Can Stop Being An Upcoming Artist And Become A Superstar