I'm making a Geometry Wars/Asteroids kind of top down shooter. I'm using raycasts as my bullets and I have a script that shoots the raycasts at an interval, simulating an automatic laser (see below.) Is there some way I could make a "laser blast" sound play at the same time that the raycast is shooting? I want to add sound to the laser, but don't know how to do it. Can someone please help?
P.S Here's the code I use for my laser
Where yourCoolSoundEffect is an audioClip (simply drag and drop a wav file in your project window to import it as an AudioClip), and volume is a float between 0.0 and 1.0.
Read a bit on AudioClip and AudioSource in the docs to get a better grasp of what you're doing.
answered Mar 29 '12 at 02:10 PM