- Home /
Question by
buildman99 · Jul 10, 2011 at 05:58 PM ·
errorsoundaudiosourcesyntax-errorbce0023
sound on button press error + its firing when space is pressed
This Is The Error:
Assets/BulletSound.js(6,28): BCE0023: No appropriate version of 'UnityEngine.AudioSource.PlayClipAtPoint' for the argument list '(UnityEngine.AudioClip)' was found.
This Is The Code:
var GunSound: AudioClip;
function Update(){
if (Input.GetButtonDown("Fire1")){
//shoot the bullet
AudioSource.PlayClipAtPoint(GunSound);
}
}
Comment
Answer by Dreamblur · Jul 10, 2011 at 08:27 PM
The error is telling you exactly what's wrong with your code. There is no overload for the method using those parameters. The method requires an AudioSource and a Vector3 as parameters (and an optional float), and you're only passing it an AudioSource. Add a Vector3 there and you're golden.
Your answer
Follow this Question
Related Questions
How "include" the Raycast?! 1 Answer
Broken Script Help 1 Answer
Scripting error: ';' expected. Insert a semicolon at the end. 2 Answers