First of all iam not sure if iam posting this to the correct section if not iam sorry . Second i notice that in MonoDevelop editor the auto correction for javascript it doesnt work . Does this mean that Unity is willing to abandon JS ? If that its not the case , can anyone tell me how to enable the auto correction (suggestion). I want an answer to this because as JS programmer i want to focus on one game engine , if Unity is not willing to support the JS in the future plan to move on other game engine.
I dont know about getting monoDev to support it, since i use VS and C#, but keep in mind what unity calls javascript, is not real javascript. It is its own langauge that is loosely based on the ecmascript standard but wrapped around the mono/.net toolset
If Unity abandons JavaScript it will be the result of the community no longer using it. Last time statistics were given was back in September 2014 and UnityScript was only used by one-fifth of the community. We’ve lost most of our learning materials for JavaScript and it’s becoming far less common in the Scripting section.
Good luck. Last I checked there were no major engines on the market using JavaScript other than Unity. If they abandon JavaScript you’re pretty much out of luck. You’ll either have to learn a new language or build your own engine from scratch.
I don’t recommend the latter by the way. Building your own engine is far more difficult than learning a new language.
A programming langauge is just a tool. No point using a hammer for every job when what you need is a drill. Learning multiple languages just lets you grow as a programmer.
Yes i know that UniScript it has very simillar syntax with javascript . Does that apply to C# as well? I mean C# use the same syntax in Unity or it has difference ?
The syntax is superficially similar between UnityScript and JavaScript. But as soon as you get to doing anything real UnityScript isn’t even remotely similar to JavaScript.
UnityScript is a statically typed, class based, OOP language. It has more in common with C# then it does JavaScript.
UnityScript has already been abandoned. Just no one has told the marketing team yet. It currently doesn’t cost Unity anything to leave the compiler in. But you can bet it will be dropped in a flash if it ever does become a real expense.
Really? Where are you going to go? No engines support JavaScript.
If I remember right, Unity said the main reason their pseudo-JS still exists is because the editor uses it internally and it isn’t worth the effort to rewrite those parts yet.
That’s as good as dead, if you ask me. But then, I’m heavily biased.
We’re not going to yank it out just yet but as other people already pointed out it’s usage is declining quite a bit. And at some point it will not make much sense for us to support it anymore.
You can however keep on using whatever Unity version might be the last one to support UnityScript.
This point get’s made every single time someone mentions “javascript” in Unity. But until Unity officially changes all their documentation and tutorials and replace “JS” and “Javascript” with “US” and “Unityscript” you cannot blame anyone on this forum for using the term javascript.
Right, we can’t blame anyone except the Unity employees that continue to refer to it as “JavaScript” (not all of them do this as you’ll notice in this very thread), but that doesn’t change the fact that it isn’t actual JavaScript. If @Clickys is serious about sticking with JavaScript then he’ll have to learn those differences.
UnityScript is actually very similar in syntax to C# so the transition wouldn’t be hard and I would highly recommend you move to C# for Unity development. There are many more (and generally better quality) samples and examples and learning resources out there in C# specific to Unity than there are for UnityScript.
UnityScript allows you to be more loose with your typing than C# does, but as a standard practice I’d advise against that as it makes debugging a bit more difficult and code intent much harder to understand at a glance. Method declarations and a few other things are different, but the transition is easy. Let’s take a look at some examples.
Typing
// Typing in UnityScript
var position : Vector3 = Vector3.zero;
//Typing in C#
Vector3 position = Vector3.zero
//or
var position = Vector3.zero //implicitly typed
//UnityScript
function GetString() : String {
return "this is the string.";
}
//C#
string GetString()
{
return "this is the string";
}
Functions Parameters
//UnityScript
function AddNumbers(num1 : int, num2 : int) : int {
return num1 + num2;
}
//C#
int AddNumbers(int num1, int num2)
{
return num1 + num2;
}
Generics
//UnityScript
var strings : List.<String> = new List.<String>(); //notice the "." (period)
//C#
List<string> strings = new List<string>();
//or
var strings = new List<string>(); //implicitly typed
There are lots more differences, like access modifiers and the like but they’re pretty easy to pick up and the real differences between UnityScript and C# are pretty minimal… it’s easy to transition from one to the other with a bit of practice and I’d highly recommend making that move.
if you wanted to use something like boo, f# or vb you could always compile the assembly yourself in visual studio and drop it in the unity plugins folder.
Since I went straight to C#, I didn’t realize Boo and UnityScript were two different things until just now. I’ve learned to avoid non-standard language lock-in for anything I’m at all serious about. Come to think of it…
Boo … which is sort-of but not really Python.
UnityScript … which is sort-of but not really JavaScript.
C# … which is almost but not really C# v3 let alone C# v6 (or soon, v7).
.NET … which is sort-of .NET 3.5 but not really, and certainly not 4.6.
Seems like Unity could really crank up their productivity by not reinventing so many wheels. (Yes, I know much of this is finally roadmapped / planned etc.)