- Home /
Question by
CrilleStyles · May 03, 2014 at 10:17 AM ·
script.
Wrong with script
What's wrong here?
var handGunShot : SoundClip;
function Update(){
if (Input.GetButton("Fire1"){
//shoot the bullet
audio.PlayOneShot(handGunShot);
}
}
Comment
So... the audio isn't playing? You need to add AudioSource component to the gameobject.
Please provide more information. What isn't working? Do you get any errors? If so which ones (actually post them)?
You should be much more descriptive when asking questions. Without a good question, you're guaranteed to get terrible (if any) answers.
Your answer
![](https://koobas.hobune.stream/wayback/20220613144139im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Large number of same scripts 1 Answer
Unity UI 4.6 Canvas Enable/Disable make Accessible 2 Answers
Is there a way to get the scripts of an Unity project built in VS? 1 Answer
Why won't my scene play? -1 Answers
SCRIPT FOR UNITY 5 (TRIGGER SOUND) 2 Answers