Spaceship Game Made with Unity: Adding Powerup SFX

Powerup indicator!!!

Rusben Guzman
Jul 12, 2021

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.

--

--

Rusben Guzman
Rusben Guzman

Written by 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.

No responses yet