Skip to main content

STOP: this is probably not the tag you want. UnityScript is a deprecated language. For new questions about scripting in Unity, you probably want the tags "Unity" and "C#". Only use this tag for questions about legacy code written in UnityScript, the old JavaScript-like scripting language available until Unity version 2017.2.

UnityScript was a JavaScript-like language supported in some versions of Unity for scripting game behaviour.

Though syntactically similar to JavaScript, it features a number of differences, most notably the use of classes as opposed to prototypes, .NET-style public private protected static keywords, the lack of with or delete, and its this keyword behaves like C#'s rather than like JavaScript's.

As of August 2017, Unity is officially deprecating UnityScript:

  • No new Asset Store submissions containing UnityScript code will be accepted
  • The Create Assets menu no longer contains an option to create "Javascript" (UnityScript) assets as of Unity 2017.2
  • Future versions of Unity will eventually omit the UnityScript compiler and will not recognize .js files as code.

If you are using UnityScript in a Unity project, it would be wise to update or replace it with C#, to ensure future compatibility and to take advantage of features available in more recent versions.

The UnityScript compiler remains available on Github in case users need it.