You have a lone “/” on line 42, delete it or comment it out by changing it to “//”. Also, you have an extra “;” on line 36, delete that one as well.
It would also be a good idea to try and be consistent with the way you use braces and indentations. It’s technically not necessary, but trust me, when you start writing more code you’ll be glad if you’ve made it more readable. Here’s an example of cleaner indentation and bracing:
function exampleFunction() {
var a = 0;
var b = 1;
var c = 0;
if (a > b) {
b = a;
if (a > c) {
c = a;
}
}
return b;
}
First, it is not void OnCollisionEnter(Collision) but
function OnCollisionEnter(col:Collision){}
since you are in UnityScript
Also, the OnCollisionEnter should be outside the Update, you cannot declare a function inside another function. This is programming basic, not only in Unity