What Language is Used To Develop Using Unity

129,717

Solution 1

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 2

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 3

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 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

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)

Share:
129,717

Related videos on Youtube

some_id
Author by

some_id

Updated on July 05, 2022

Comments

  • some_id
    some_id almost 2 years

    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.

  • some_id
    some_id about 13 years
    So C# which converts to iOS deployment. But development is done using C# and not obj c for iphone
  • Ryan
    Ryan over 12 years
    Up vote what I think is the best answer. Just to make sure I'm reading it right, so I can write a game in unity using JS and then run it on an iPhone or Android device because it converts JS to objective-c for you? Thanks.
  • user1708601
    user1708601 over 12 years
    Yep! You can only write in JS, and end up with a game that runs on Windows, OS X, a web browser plugin, iPhone, Android, PS3, and Wii. (Note: All but the first three require additional licenses.)
  • Stephan van den Heuvel
    Stephan van den Heuvel over 10 years
    @CodyHatch "Depending on the platform that might end up being Objective C or something else" nope. For iPhone builds, Unity has some built in Obj-C boilerplate to interface with some cocoa-touch frameworks, but all of your code is compiled into Arm Assembly. Also you totally can write Objective-C plugins to do stuff like payments and notifications.
  • Przemysław Wrzesiński
    Przemysław Wrzesiński almost 10 years
    "Newcomers often assume JS isn't as good as the other three, but it's compiled and just as fast and functional." - sorry for ressurecting an old thread, but I must say this part is absolutely wrong. I run several benchmarks and JS works much slower than C# (up to 100 times in heavier computations). I recommend C#.
  • m4rtin
    m4rtin over 9 years
    Could you explicit your answer ? Why do you think C# is faster in comparison of the other two ? Please provide references.
  • Sadık
    Sadık over 9 years
    For Android: Even in the free version! It's very easy. Just write in C# or JavaScript, and click on build, chose Android and you're done. Unity is great in building for different targets.
  • temporary_user_name
    temporary_user_name almost 8 years
    Is this answer still up-to-date?
  • temporary_user_name
    temporary_user_name almost 8 years
    Is this answer still up-to-date?
  • GDP2
    GDP2 about 6 years
    @Aerovistae I know this is late, but as of 2018, UnityScript and Boo are totally deprecated. They will eventually be completely spiked, as Unity believes that few people are using these languages anymore. C# is set to be the sole language of Unity, so there is no choice in the matter anymore. See this blog post for more info and this Github repository for a tool from Unity that is supposed to convert UnityScript to C#.
  • temporary_user_name
    temporary_user_name about 6 years
    Thank you! Always better late than never
  • maxkoryukov
    maxkoryukov almost 5 years
    I'm not an expert, but it seems like Java is not a Unity-supported language