Spaceship Game Made with Unity: Adding Laser SFX

Adding an audio for the player shoot action

Objective: Play a laser sound effect when the player shoots.

I opened the “Laser” prefab and added an AudioSource component, checked the “Play On Awake” attribute and added the clip to the AudioClip.

That’s it! In this case we don’t have to do anything else, when the player instantiates a laser the sound is gonna play automatically because the “Play on Awake” attribute allows to play the SFX when the GameObject is created.