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.