- Home /
CE0044: unexpected char: 0x2028.
I'm trying to make a pause menu and I'm getting this error on the first line. I tried deleting #pragma strict and it had the same error on the first line which was now the 'private var etc etc'.
I don't know what's going on I just want a freakin' pause menu and I'm having a lot of problems haha. I'm really stupid and suck at using this program (I'm doing it for an assessment) so if you know what's wrong with the code please dumb it down your explanation for me lol.
Here's the code:
#pragma strict
private var pauseGame : boolean = false;
private var showGUI : boolean = false;
function Update()
{
if (Input.GetKeyDown("p"))
{
pauseGame = !pauseGame;
if (pauseGame == true)
{
Time.timeScale = 0;
pauseGame = true;
(GameObject.Find("Main Camera").GetComponent ("MouseLook") as MonoBehaviour).enabled = false;
(GameObject.Find("First Person Controller").GetComponent ("MouseLook") as MonoBehaviour).enabled = false;
showGUI = true;
}
}
if (pauseGame == false)
{
Time.timeScale = 1;
pauseGame = false;
(GameObject.Find("Main Camera").GetComponent ("MouseLook") as MonoBehaviour).enabled = true;
(GameObject.Find("First Person Controller").GetComponent ("MouseLook") as MonoBehaviour).enabled = true;
showGUI = false;
}
if (showGUI == true)
{
gameObject.GetComponent<GuiTexture>("PausedGUI").enabled = true;
}
else
{
gameObject.GetComponent<GuiTexture>("PausedGUI").enabled = false;
}
}
Answer by Dave29483 · Nov 16, 2016 at 08:46 AM
It means that at some point you may have pasted some code into your editor which contains a unicode character.
To fix it, select all code, paste into Notepad++ or any other text editor which supports character set conversion, then convert to ASCII.
Once done, paste back into your editor. The offending character will be an invisible one.
0x2028 is the unicode line separator.
Your answer
Follow this Question
Related Questions
Struggling with my pause menu and main menu 1 Answer
Pause Menu Issue (Black Screen) 0 Answers
How can I detect if the game's window has been taken down? 1 Answer
Countdown after resume game. 4 Answers
Can this be converted into C#? 2 Answers