Spaceship Game Made with Unity: Adding Powerup SFX

Objective: Play a sound effect when the player collects a powerup

Now It is time for the powerups. First I created an empty game object called PowerupAudio as a child of the Audio Manager, unchecked the “Play On Awake” attribute and assigned the clip.

Then in the player script I created an AudioSource variable and assigned the reference in the Inspector. Next I created a public function to play the sound.

In the powerup script I called the PlayPowerupAudio from the player game object when we check the collision with the player.

And that’s it! SFX for powerup collection.

--

--

--

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.

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

Recommended from Medium

Upcoming improvements to Angular library distribution

Create Translated Subtitles(Video to srt File) with Google Speech-to-text, Cloud Translation, from…

AWS: Services Domain in AWS

Symfony Request & Response flow

My experience so far at the bootcamp

You don’t need to know everything to be a good developer.

Installing Parrot in Virtual Box

F-Droid: installing very old versions of app

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
Rusben Guzman

Rusben Guzman

A Software Engineer passionate about game dev and interactive products with Unity. I consider video games to be the artistic expression of programming.

More from Medium

How to Build an Interactive Security Camera System in Unity

Pushing a box

Quick tip — Enabling post-processing in Unity Universal Render Pipeline

Building A Stealth Game — Using The Mouse For Movement