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

Madness [No Spoilers]

KubeCon 2019 Barcelona — Impressions and More…

gRPC: How to Make Client Streaming Calls

Universe

New Year Goodies — Oracle JDBC 21.1.0.0 on Maven Central

Become a developer in 10 minutes.

An Open Source API driven PWA. Introducing Contenta.

Guide to sending JLA requests in Postman

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

Alan Turing: The Enigma

Image Captioning — from theory to implementation

3 rd week MY Jounery to DLithe BOOTCAMP

Holiday is synonym of consumption for Brazilian society