Java or Python?

Was reading through a couple of the scripting tutorials and noticed they’re all in Java. I had planned on learning/scripting in Python but I’m wondering whether or not this is a good idea. I’d really like to stay away from Java but if it’s recommended that I take that path then I will.

If it’s o.k. to stick with Python can I only translate the tutorial examples from Java to Python by gaining the requisite experience or is there a simpler way?

All input welcome.

Unity does neither support java nor python, so no idea what you were reading

Hmm, the tutorials here http://unity3d.com/support/resources/tutorials/fpstutorial are all in Java.

Enlightening, but it doesn’t answer my question. Learn java script or python?

Or is it the case that the game only works with java script which means I misremembered reading that it also could use Python.

Unity can use Boo, which is similar to Python, but isn’t Python. Unity’s Javascript is unique to Unity, although it’s fairly close to JScript (and actually not so much like Javascript).

–Eric

While we’re at it, JavaScript is one word. But you’re probably thinking of Boo, which is a Python-inspired language that you can use in Unity. You’ll have a much harder time learning Boo because basically nobody else uses it around here. I don’t recommend either of the languages you mentioned, and suggest C#, but either JavaScript or C# makes sense.

Oops, Eric beat me to the punch.

If you’re new to scripting, choose javascript, since it has more documentation and is relatively easy to learn.

Use Boo if you have prior boo/python experience, and don’t intend to program for the iPhone.

Thank you very much, I don’t know where I got the idea that the game used Python (too much late night reading I guess) but I will venture forth in javascript.

Another option for script is VBScript if Unity3d does support it. It is same as JavaScript but my personally opinion is JavaScript because it is used more compare to VBScript. So, this is the best option for scripting.

vbscript is not supported

You have C#, “Javascript” and Boo

A lot of people think JScript and JavaScript are related languages but they are just different names for the same language - the reason the names are different was to get around trademark issues between Sun and Microsoft.

Are there definite reasons that make C# the best option for Unity development? Is there a downside to using JavaScript for Unity development?

Personally, for me, C# is a good way to go, especially if you use Visual Studio for scripting. It really forces you to write good, tightly-coupled code. I don’t have any experience scripting Javascript in Unity (only C#), but I do have a lot of experience coding Javascript in web pages and programming C# applications and given the choice, for me, C# wins always.

Keep in mind we’re actually talking about JScript .NET here, in which case there are some significant differences compared to Javascript. For example, JScript allows you to specify the type when declaring variables:

var foo : int;
var bar : String = "abc";

which doesn’t work in web Javascript at all (because it’s dynamically typed, and JScript isn’t really, although it can make use of dynamic typing). Also, there is no “prototype” for functions in JScript; instead you use classes similarly to C#. Plus other stuff.

Basically, web Javascript programming is different enough compared to Javascript programming in Unity that I would call it a different language. I don’t actually care for web Javascript that much; I find Unity’s language rather nicer.

There generally isn’t any “best”; it mostly depends on what you’re doing. C# has some features that Javascript doesn’t have, so if you need those features, then you obviously have to use C#. Vice versa is also true. Otherwise it’s a matter of preference.

–Eric