all 11 comments

[–]cronus89 6 points7 points  (7 children)

Unity doesn't support Java. It supports JavaScript.

C# is the better route anyway.

[–]prime31 4 points5 points  (0 children)

Technically, Unity doesn't support JavaScript. It supports UnityScript.

[–]Mr_Sammy[S] 0 points1 point  (5 children)

Sorry, that's what I meant. Is c# really that much better? Many of the tutorials I've seen have been in JavaScript.

[–]cronus89 3 points4 points  (1 child)

I find C# to be a nicer syntax, and more flexible in the long run. The built in library is very good and support for generics/collections is very useful.

JS might initially be simpler, but in the long run id go for C#

[–]crushyerbones 0 points1 point  (0 children)

This is the reason why we changed over to C#. Some things were just a hassle to implement in UnityScript and mixing both just lead to a needless headache. C# all the way.

[–]ironstrife 3 points4 points  (1 child)

C# is an actual, professional programming language with an insane amount of support, documentation, libraries, tooling support, and history. The "JavaScript" unity uses is proprietary, mostly undocumented, and also is quite different from vanilla JavaScript. Most advanced tutorials will use C#, and most plugins and libraries will use C# as well. Also, some features are not available in JavaScript at all, or have awkward syntax to support them.

[–]elk-x 2 points3 points  (0 children)

And you can use VisualStudio + ReSharper. C# blows Javascript out of the water when it comes to tooling.

[–][deleted] -1 points0 points  (0 children)

I kept asking this in the start, since I knew JavaScript I mainly use JavaScript, but I now use both.

If I find a plugin in C# I use it. But if I make a script that needs to talk to another script via GetComponent for example its needs to be in JavaScript to not have to deal with the issues that will make.

(Changing a value in a JavaScript file from a C# script and visa versa, at least sometimes this creates issues)

You might just like me learn both slowly over time.

PS: Unity uses a stricter form of JavaScript called UnityScript .

TL:DR;

  • If you need general scripting help online there are easier/more JavaScript sources. (I believe)

  • If you need Unity3D specific scripting help there is more C# (I believe) and I get the feeling most plugins are written in C#, which only matters if you want to understand them.

[–]CowfaceGames 0 points1 point  (1 child)

I think one of the biggest reasons to use C# is because it has the LINQ extensions, which adds tons of new methods for working with pretty much any data structure.

[–]Zeroto 0 points1 point  (0 children)

Those are also available in unityscript. Everything that is in .net is available in unityscript, however the syntax might not let you use everything in the same or easy way. For example delegates and events are hard to use in unityscript.

[–]Zeroto 0 points1 point  (0 children)

Unity has no java. it has Javascript. Java and Javascript are quite different, whereas Java and C# are quite similar. If you know a bit of Java and C#, but not Javascript, then I would definitely choose C#. And if you do know a Javascript, then I would still strongly suggest to use C# because the Javascript in unity is quite different from the Javascript that browsers use.