Unity 3D – C# or Javascript? [UnityQuickTips]




Unity3D Tutorials – This video will be going over the basic differences between C# and Javascript in Unity 3D and help new users choose which language is right for them.

Original source


23 responses to “Unity 3D – C# or Javascript? [UnityQuickTips]”

  1. Man,that was exactly what I was looking for,it cleared my mind a little bit. My first(and currently only)language that I learned was Javascript,and now I´m moving toward learning c#. Could you please recommend me some tutorial serie or stuff like that about c#? Oh,and by the way,I heard that Unity is pottentially taking out javascript out of its compatibility,just like it did to boo. Do you think that is really going to happen(sorry my english)

  2. I know JavaScript pretty well, and a lot better than I know C#, but Ima go with C# because it's pretty much the opposite of JavaScript and that will make me a better programmer if I know both

  3. I think if you wanna start making games in Unity, then go With C#. But you can also learn yourself Javascript to make websites for example. It might happen that you know one script in C# and another one in Javascript and you can use both scripts in the same scene in unity which is awesome. C# is cleaner and i would recommend you choosing C# and eventually learn Javascript after you have a great knowledge for C# and you know a lot of basic scripts. I hope this helped! Thank you.

  4. //UnityScript vs C#

    description
    if you are new to UnityEngine and new to programming, I recommend you to study UnityJs first.. There are people who will suggest C# because they were already SKILLED PROGRAMMERS! so c# is easier for them to understand. C# is a high level OOP language. They say that C# runs faster than unityJs and has more access to system, editor tools, libraries etc…

    code
    UnityScript is not Java!!
    UnityScript is not the Javascript you use on web browsers.
    UnityScript is MODELLED IN JSCRIPT.

    variables
    C# : Type first then Name.

    (public GameObject cube;)

    Js : Name first then type
    (var cube : GameObject;)

    * Syntax: Js vs C# *

    Let's write a simple hello world console program!

    "UnityScript"

    #pragma strict
    function Start ()
    {
    Debug.Log("Hello World!");
    }

    "C#"
    using System.Collections;
    using UnityEngine;

    void Start () {
    Debug.Log("Hello World!");
    }

    hope this helps.. you can visit Unity's documentation for tutorials

  5. The Javascript you use in Unity is very diffrent from Javascript you learn for say web-based stuff, and it's not simply a question of diffrent names for stuff.

    Javascript is awesome if you use weak typing. You bake that assumption into your design, and it lets you build dynamic objects very easily, attach, copy and rename functions to things, ect, I ended up deciding on C#, even though i have much more javascript expeirance with web stuff I've done. The diffrences are enough, that at least for me, I feel the tremendous power of prototypal, weakly typed languages, isn't really accessible. It's not just weakly typed variables. It's being able to augment objects as needed, instead of having a stiff class you build th at accounts for every possible permutation up front.

    I don't know much about games, but if i had to guess, I would say weak typing could potentially be pretty dangerous in a game enviroment. Where as in web, since there is often uncertainty in the data your getting, weak typing can be a good thing, so that you fail more gracefully instead of exploding when data comes back in an unexpected format.

  6. I'm very torn. I want to mostly make RPG style games, and if I learn Javascript, I can apply it to both Unity and RPG Maker MV. I am not a programmer, I am pursuing design mostly, but I want to be able to do it all myself, so I can work on hobby projects and flesh out my understanding of games in general. I do have some C++ experience, but I am not sure what to do.
    Also where should I be practicing Javascript? Visual Studio doesn't work and I cannot find a clear answer or equivalent program.

  7. You can use a third part script application and sync is to Unity so you don't have to use Mono. Also, doing 3D and 2D games are not that much different. Just do what is best for you. I like to do both and both scripts. 🙂 I have been programming for a long time, even back in the day using Basic and MS-DOS to create games on the C64 and Amgia.

  8. Is JavaScript in Unity the same as on the web and can you use web content in unity? In other words… can I use and interact between the web and unity apps? Say if you where to export your game to html and have it interact with other content on the site?

  9. There is an interesting article found here (http://wiki.unity3d.com/index.php?title=UnityScript_versus_JavaScript) that explains the difference even between UnityScript and JavaScript. I personally tend to lean toward C# myself as it feels less vague, more structured, and the syntax applies to development outside of the Unity environment. For the time you will spend learning a new language, I think you would get the most return from coding in C#.

    There are also some good points made about considering developing with Boo here: (http://answers.unity3d.com/questions/220984/why-script-in-boo.html)
    But to me the benefit of having the majority of tutorials written in C# at this point makes it a no brainer.

Leave a Reply