Hello! I happen to be making a horror game and I need help on how to make sfx timing in JavaScript. Here is my code:
function Update () {
if (Input.GetKeyDown(“q”))
AudioSource.PlayClipAtPoint;
}
whenever I type this in, it gives me an error saying this:
C:\Users\D\Documents\New Unity Project 2\Assets\Flashlight sfx.js(13,13): Error BCE0034: Expressions in statements must only be executed for their side-effects. (BCE0034) (Assembly-UnityScript)
It looks like you are invoking a method PlayClipAtPoint(…parameter?..). Method’s take parameter’s, and like @liortal explains, you need to pass something into the PlayClipAtPoint method. IntelliSense tells you what to pass in the method if you type this much: “A dialog should pop up telling you what to do”.