What Language is Used To Develop Using Unity

Unity3d

Unity3d Problem Overview


What language does one need to use when programming with Unity? Or is it an API for many languages?

I read through the docs and I guess I missed the point on the language used.

It says it has iOS deployment, would this still allow the programmer to code in objective C?

Is Unity an sdk which can be used for many platforms or how does it work? It mentions deploy the same code on multiple platforms.

Unity3d Solutions


Solution 1 - Unity3d

All development is done using your choice of C#, Boo, or a dialect of JavaScript.

  • C# needs no explanation :)
  • Boo is a CLI language with very similar syntax to Python; it is, however, statically typed and has a few other differences. It's not "really" Python; it just looks similar.
  • The version of JavaScript used by Unity is also a CLI language, and is compiled. Newcomers often assume JS isn't as good as the other three, but it's compiled and just as fast and functional.

Most of the example code in the documentation is in JavaScript; if you poke around the official forums and wiki you'll see a pretty even mix of C# and Javascript. Very few people seem to use Boo, but it's just as good; pick the language you already know or are the happiest learning.

Unity takes your C#/JS/Boo code and compiles it to run on iOS, Android, PC, Mac, XBox, PS3, Wii, or web plugin. Depending on the platform that might end up being Objective C or something else, but that's completely transparent to you. There's really no benefit to knowing Objective C; you can't program in it.


Update 2019/31/01

Starting from Unity 2017.2 "UnityScript" (Unity's version of JavaScript, but not identical to) took its first step towards complete deprecation by removing the option to add a "JavaScript" file from the UI. Though JS files could still be used, support for it will completely be dropped in later versions.

This also means that Boo will become unusable as its compiler is actually built as a layer on top of UnityScript and will thus be removed as well.

This means that in the future only C# will have native support.

unity has released a full article on the deprecation of UnityScript and Boo back in August 2017.

Solution 2 - Unity3d

As far as I know, you can go with c#.

You can also use the obscure language "Boo". (Found at https://boo-language.github.io/)

In the past (before about 2012) it was possible to use a strange variant of Java but that is now deprecated and does not work.

Note that Unity builds to Android / iOS, and many other platforms. The fact that iOS programming uses objective-c or Swift, is, completely irrelevant at the Unity3D level. Unity is programmed using c#.

Solution 3 - Unity3d

When you build for iPhone in Unity it does Ahead of Time (AOT) compilation of your mono assembly (written in C# or JavaScript) to native ARM code.

The authoring tool also creates a stub xcode project and references that compiled lib. You can add objective C code to this xcode project if there is native stuff you want to do that isn't exposed in Unity's environment yet (e.g. accessing the compass and/or gyroscope).

Solution 4 - Unity3d

Unity3d supports C#, Boo and JavaScript. The framework translates this into its intermediate format and later to the desired platform (IOS/Android/Linux/Windows)

Keep in mind, C# Scripts are compiled first, followed by JS and Boo Hence if you want a C# script to interact with a JS, you ll have to keep the JS in the Standard Assets Folder.

Solution 5 - Unity3d

Unity supports:

  1. UnityScript(Is known as Javascript but includes more functionality for the Unity game engine. I think this could be very easy to learn)
  2. Boo (No experience)
  3. C# (I prefer this as it is useful to learn and you will be able to use this outside of unity as well. I also think it is easy to get used to)

Solution 6 - Unity3d

Some of the core differences between C# and Javascript script syntax in Unity.

http://unity3d.com/learn/tutorials/modules/beginner/scripting/c-sharp-vs-javascript-syntax

but keep in mind C# is the best one to develop in unity

Solution 7 - Unity3d

You can use C#, Javascript, Boo.

Unless computing requirement for the function you write cause heavy load on processor, Javascript gives good enough performance for most cases.

Solution 8 - Unity3d

It uses c#, and unityscript(javascript), which is supported by the source code in c++, and c++ plugin support(source code, and plugins require pro).

The unity3d script reference is really easy to understand/use if needed, probably the easiest out of engines like cryengine, udk, etc.

Hope this helps.

Solution 9 - Unity3d

One can use any one of the following three scripting languages:

  1. JavaScript
  2. C#
  3. Boo

But my personal choice is C# because I find it faster in comparison to other two.

Solution 10 - Unity3d

I remember this from reading some articles about performance in Unity from internet which was warning JavaScript users from using it in Unity about really massive issues of using JavaScript in unity instead of C#, it says that C# is almost 4x faster than JavaScript!.

I really appreciate that article because it saved me when I was about to start gaming, I don't mean that JavaScript is bad for unity developers , it is good but my advice could be that if you like using JavaScript, you should use it for simple small games NOT FOR BIG PROJECTS because it really can be a big problem!

Solution 11 - Unity3d

right now only C# can be used for scripting support for Boo and Javascript was removed.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionsome_idView Question on Stackoverflow
Solution 1 - Unity3dCody HatchView Answer on Stackoverflow
Solution 2 - Unity3dAndreas WongView Answer on Stackoverflow
Solution 3 - Unity3dCalvinView Answer on Stackoverflow
Solution 4 - Unity3duser1438327View Answer on Stackoverflow
Solution 5 - Unity3dalexo1001View Answer on Stackoverflow
Solution 6 - Unity3dMuhammed AlbarmaviView Answer on Stackoverflow
Solution 7 - Unity3duser3112151View Answer on Stackoverflow
Solution 8 - Unity3duser3210251View Answer on Stackoverflow
Solution 9 - Unity3dMayank GuptaView Answer on Stackoverflow
Solution 10 - Unity3damdevView Answer on Stackoverflow
Solution 11 - Unity3dIbrahimTG99View Answer on Stackoverflow