- Home /
Compiler Error: unexpected char
Does anyone see the "unexpected char" error in this script?
var Weapon01 : GameObject;
var Weapon02 : GameObject;
function Update ()
{ if(Input.GetKeyDown(KeyCode.Q)) { WeaponSwitch(); }
}
function WeaponSwitch()
{ if (Weapon01.activeInHierarchy == true ) { Weapon01.SetActive(false); Weapon02.SetActive(true); } else { Weapon01.SetActive(true); Weapon02.SetActive(false); }
}
Comment
Answer by robertbu · Oct 30, 2013 at 06:00 AM
A high-bit ascii character made its way into your code. It is on line 6 between the double closing parentheses. You can see it if you past your script into a world processing program, a hex-dump program or even TextEdit on the Mac. The easiest solution is to delete and retype the line (or just delete the '))' and retype them.