- Home /
DYNAMIC SOUND
iam developing some Dynamic audio in game, i mean when you SHOT a gun the player will hear 3 different sounds, (Left, Center, Right)
the center sound is the main shooting sound, but the side sounds are ambient sounds... the thing is.. im recently learning JS and C# and i dont know how to do it but i know that it is possible... i think using RAYCAST... can i use it? to shot a line in left-right directions and that give me the distances, and with that information manipulate the volume of the side sounds?? this is my actual code:
var FireShot = GameObject;
private var FireShotEnabled : boolean = false;
var ShotFX = AudioClip;
var ShotAmbientFX = AudioClip;
function FireShot ()
{
if (Input.GetButtonDown("Fire1")) {
FireShotEnabled = !FireShotEnabled;
FireShot.enabled = LightEnabled;
audio.PlayOneShot (ShotFX);
audio.PlayOneShot (ShotAmbientFX);
}
}
the FireShot correspond to the Muzzleflash effect that iam using, and the other thing you can figured out...
like i said im starting to learn, maybe my code is crap, you let me know :)
greetings and THANK YOU!
WHY THE ALL CAPS TITLE? YOURE JUST HURTING THE VIEWS ON YOUR QUESTION. $$anonymous$$AYBE YOU SHOULD CO$$anonymous$$E UP WITH ANOTHER $$anonymous$$ETHOD TO FOR$$anonymous$$AT YOUR TEXT INSTEAD OF PUTTING YOUR TEXT IN ALL CAPITOLS. IT'S NOT ONLY HARDER TO READ, PLAIN RUDE AND ANNOYING, BUT IT WILL ALSO STOP PEOPLE FRO$$anonymous$$ EVEN WANTING TO READ YOUR QUESTION TO BEGIN WITH.
do you like getting yelled at?
Your answer
Follow this Question
Related Questions
Ambient audio 1 Answer
Advance when the sound is done playing 1 Answer
Raycast Decals,Sound and MuzzleFlash not working too well 0 Answers
Multiple/Different footsteps sounds (solved) 2 Answers
help with multiple sounds 0 Answers