- Home /
how to add sound to my reloading animation?
well my gun has a reloading animation, and I want to know how to play a certain sound evert time when i press the r button. Please explain how you do this. thanks!
Answer by FLASHDENMARK · Jan 16, 2011 at 07:53 PM
var reloadSound : AudioClip;
if(Input.GetKeyDown("r")) { audio.PlayOneShot(reloadSound); //Reload script here }
This should do the trick. :)
now where exactly would I place this js file? and do I need to make a audio source file or a audio listener file too? or is this all i need?
You just need to attatch the script to the object that you want to reload. And you need to attatch a audio source to it too. And then it should work. :)
I did exactly as you said but it still does not play the sound when I reload. In the script you gave me, do i have to copy and paste my reloading script to the part of your script thats says: //Reload script here?
and what do i have to place "reloadSound" with? my sound?
Answer by apukommander · Feb 02, 2011 at 02:56 PM
i not fukesing horrible player kid guy.
Excuse me?
This is not the prober place to make answers like that...if there even are any places for answers like that.
Your answer
Follow this Question
Related Questions
Animation and sound help 0 Answers
I have two animations, on the same parent object and how do i make them play at different times. 2 Answers
C# animation script for reloading a gun 3 Answers
Reloading Help 2 Answers
Sound is not playing. 2 Answers