i have no idea how to fix this... my script is:
var range: float = 5; // define the detection distance private var hit: RaycastHit;
whenever i try to go into play mode i get this... Assets/sound file lomg.js(9,15): BCE0043: Unexpected token: soundScript. i have been messing with it for hours but with no success, what do i do?
Well, the error tells you that the problem is on line 9 of your source code. That's the meaning of the lomg.js(9,15) in the error message. So, we've narrowed the problem down to a single line. The compiler says that it doesn't understand what soundScript is. I am guessing that your line 9 is this one:
I don't know for sure. The compiler complains about soundScript and you only have SoundScript with a capital S. So something is wrong in your question. The use of single quotes around the variable type on that line looks wrong. The example at the bottom of this page:
shows how to use GetComponent correctly.
answered Oct 19, 2012 at 12:35 PM
Graham Dunnett ♦♦