|
can someone help me out with this plz. right now i got the barrel to explode but i cant seem to get my sound to play when the barrel explodes.
(comments are locked)
|
|
You might want to use PlayClipAtPoint for this. It's great for one-off sound effects which can occur at an arbitrary position in your scene. How you do this might depend on how you're detonating the barrel. If you have some function on your barrel which handles the explosion, you might do:
You'd then need to make sure you drag in a reference to the audio clip, into the "explosionClip" variable in your barrel object (or prefab). Hi thanks for getting back to me... theres a small issue here. I'm using the script from FPS tutorials "DamageReceiver.js" using that script i got the barrel to employed but after updating it with your scrip its still not playing the sound. I'm i doing something wrong.
Feb 24 '10 at 04:00 PM
Anoj
Are you getting any errors when the sound is supposed to play? Did you put the line "AudioSource.Play...etc" into a function that is actually called, or did you just add the whole Explode() function? Did you drag the explosion sound audio clip into that variable in the inspector?
Feb 25 '10 at 10:42 AM
duck ♦♦
(comments are locked)
|
