Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

JS compilation Error

Discussion in 'Scripting' started by Mhk, Jun 27, 2012.

  1. Mhk

    Mhk

    Joined:
    May 21, 2012
    Posts:
    1
    hello everyone; I am new to unity....i just got the following error while trying to open my .js code in Mono Develop.

    C:\Documents\New Unity Project 1\Assets\MyScript.js
    Line:1
    Char:1
    Error:Invalid Character
    Code: 800A03F6
    Source: Microsoft JScript compilation error

    i just created the .js file and have not made any changes in it but it still says compilation error. additionally when i click to open c# code in the same way it does nothing. not opening mono develop for C# also.
     
  2. apparition

    apparition

    Joined:
    Jan 11, 2012
    Posts:
    116
    Are you opening the scripts from within Unity or from Windows Explorer? You have to open them from Unity.
     
  3. amoberk

    amoberk

    Joined:
    Jun 16, 2014
    Posts:
    1
    i have the same problem too can anyone help me
     
  4. WikiMalik

    WikiMalik

    Joined:
    Nov 13, 2014
    Posts:
    16
    The error message you get comes from a microsoft tool called ScriptHost. This has nothing whatsoever to do with Unity... It probably means that you have files with a .js file extension associated with that MS tool. Usually you'd create a JavaScript file from inside the Unity editor. When you edit it that file from Unity you should get a tool called MonoDevelop open which will allow you to edit the JavaScript. Instead you're getting the Windows ScriptHost, which is trying to execute the code, and is complaining about the # character. If you are trying to edit JS files from outside Unity, try using Right-Click Open With instead of double clicking. Perhaps choose either MonoDevelop or Notepad.