The choice of Unity Language is one of the first decisions a new developer has to make. When I started with Unity3D I wondered myself: man, do I really need to spend time learning C#, when I already know enough JavaScript and I can just power through with UnityScript? After a couple of years, I can tell you definitively:
Dear friend, if you are serious about game development in Unity, do yourself a favor and learn C#.
Why? Short answer: to make your life easier later on. Sooner or later you will start to:
- Use other people’s Unity Assets – and most of them are written in C#.
- Learn from and follow along tutorials – most of which implement C#.
- Look for answers to particular and exotic coding problems – and most of the answers and examples will be published in C#.
I’m not a language purist. I’ve created projects in JavaScript, PHP and C#, and I normally just look for the optimal tool for the job. I personally love the versatility of JS; on the other hand, C# is an Object-oriented programming language, which generally adds clarity at the price of complexity. Performance is practically the same with both.
However, remember that UnityScript is a proprietary language which doesn’t comply with the ECMAScript specifications. This leads to surprising results like the introduction of classes instead of using the typical (and mysterious) JS prototypes. While this and other changes are pretty neat, they often make UnityScript more similar to C# – which, you have to admit, kind of defeats the purpose of avoiding learning C#.
In the end, as soon as you get familiar with C#, you will appreciate its structure.
If JavaScript resembles a whip because of its flexibility, C# is a large battle axe.
In the beginning you might drop the heavy axe on your foot a couple of times (e.g. one of the first things you’ll do is use an Array instead of a List<T> Class), but in time the language will win you over with its organization, power and focus.
Ready to start? Unity’s learning center has an excellent introduction to scripting section here: https://unity3d.com/learn/tutorials/topics/scripting
Good luck!
P.S. For completeness sake I should mention that Unity used to support a (Python-inspired) third programming language named Boo. Poor Boo was dropped in 2014 due to a small user base. Some worry that UnityScript might follow Boo’s fate, but that’s unlikely. Even though C# is clearly favored by most Unity developers, the popularity of JS outside of Unity and its use as a low-bar entry point into the world of Unity-based games will ensure its survival and longevity in the U3D ecosystem.