Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add JavaScript support to Unity 2019?

I developed a game years ago and now decided to improve the game and started to download the unity again. after upgrading Unity I figured out Unity doesn't know all JS files and has detached them from objects. any solution that fixes the problem and adds JS support to Unity again?

like image 391
user163743 Avatar asked Feb 22 '20 04:02

user163743


People also ask

Is JavaScript still supported in Unity?

All the way back to Unity 1.0, the Unity game engine has supported a version of JavaScript called UnityScript. Today on the Unity blog, Unity have announced that they will no longer be supporting UnityScript going forward.

Why was JavaScript removed from Unity?

It's a proprietary language and it doesn't actually follow any concrete specification of standard JavaScript and is modified at will by the engine developers. > Because of this, the vast majority of JavaScript libraries you find will not work by default in Unity.

Do you need JavaScript for Unity?

Unity does not really support 'real' JavaScript, but instead support for the JavaScript-like language UnityScript. UnityScript is like JavaScript in a lot of ways, but also have some significant changes.


Video Answer


1 Answers

  1. August 2017

All the way back to Unity 1.0, the Unity game engine has supported a version of JavaScript called UnityScript. Today on the Unity blog, Unity have announced that they will no longer be supporting UnityScript going forward. Starting in Unity 2017 beta 2, they will remove the ability to create JavaScript files directly inside the editor. Then they will be removing the ability to submit .js files to the Asset Store. Then at some point in the future they will be removing the compiler completely, although it will be available to be forked on Github. According to Unity analytics numbers on a very small portion of the community is even using UnityScript at this point, with under 4% using it as the primary language.

They actually published some fairly interesting stats about language usage:

To date, of all the projects that have used Unity 5.6, about 14.6% of them have at least one file with a .js extension in it. 14.6% sounds quite high, but then we broke the numbers down further, and looked at how many files were .js files as a fraction of total script files in the project (.js + .cs). So, that leaves 85.4% of all projects which are entirely in C#, with no UnityScript files at all. 9.5% of all projects are mostly in C# – they have some UnityScript files, but fewer than 10% of their total script file count. Another 1.5% of all projects have between 10% and 20% of their code in UnityScript files. That leaves 3.6% of all projects that have more than 20% of their code in UnityScript. Only 0.8% of all projects are exclusively (i.e. 100%) in UnityScript.

With only a small portion of the community using UnityScript it does make very little sense to continue supporting it, especially now that C# support isn’t stuck in the stone ages.

like image 96
Crispi Avatar answered Sep 26 '22 14:09

Crispi