Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

UnityScript or real JavaScript?

Discussion in 'Scripting' started by StrongGuy, Jan 7, 2015.

  1. StrongGuy

    StrongGuy

    Joined:
    Aug 12, 2014
    Posts:
    13
    I've found there is a plugin named JavaScript Binding.
    https://www.assetstore.unity3d.com/#!/content/25497

    It seems I can develop game with real JavaScript by using this plugin.
    I'm familiar with JavaScript. and I heard UnityScript's syntax is not exactly the same as JavaScript.
    And by using real JavaScript I can easily update my game without users to re-install the game which can save a lot of time when deploying new contents.

    Thank you for you opinions.
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I have no knowledge of the specific plugin you describe. But be aware that by using a system like this you are limiting yourself to using features provided by the plugin. There is also a risk of the asset vendor dropping support for the asset.

    Balance this against the difficulty of learning UnityScript or C#.
     
  3. LDev77

    LDev77

    Joined:
    Jan 7, 2015
    Posts:
    21
    I would say you would most probably want to use either C# or UnityScript since most major assets in unity (such as the joystick in the mobile essentials asset) were made in these languages. Boo is also a language in the .NET Framework (Honestly, I don't like the .NET Framework but I think C++ is the best language), but not as supportive as C# or UnityScript since most video tutorials in the live training sessions like to use C# and teach in C# as well. UnityScript wouldn't be a better choice over C# since C# is really good to get a hang of in Unity3d 4.6. UnityScript takes less time to code in and is good for rapid development, but UnityScript tends to be 4 times as slower as C#. C# has some Microsoft support to help you. UnityScript lacks teaching but the documentation of unity works out. Boo has some really low tutorials and is usually used as a third language that can be used in emergencies. You can also mix 2-3 languages together in the same project too! For example, when using and programming joystick controls, UnityScript Quaternions tend to be easier to understand for some mobile platform developers. If your game also uses networking or any other thing, C# is the best choice since it has good support and is easy to grasp onto. UnityScript can be useful for secondary priorities such as the joystick controllers and you may notice that when importing the character controller asset, the first and third persons scripts are written in UnityScript instead of C# since they are better off with things like that, even though some developers look into using C# instead of UnityScript completely for even joystick controllers and any other asset scripting they need. If you find C#, UnityScript, and Boo uncomfortable to work with in your everyday developers work, you might want to get to know Unreal Engine 4 which runs on C++ and a new intuitive Blueprint system or ShiVa3d which runs on Lua and/or C++ plugins. I am currently trying Unreal Engine 4 and I would say the Visual UI Interface isn't easy to grasp onto as easily as Unity. Even though the various options, Unity and C# would work perfectly fine when making a small or large game in no matter what industry you would work in!

    P.S.
    I don't really feel comfortable with C#, UnityScript, or Boo myself. This was the reason I am currently working in Unreal Engine 4 with their Blueprint System. I still am having to grasp onto their new UI Interface for developers though. For beginners, Unity3d is the best option to start out game development on major developer platforms!
     
  4. LDev77

    LDev77

    Joined:
    Jan 7, 2015
    Posts:
    21
    It must be JsInterface since I have heard of LuaInterface as a download. I like Lua most!
     
  5. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    @LDev77 At a risk on getting into another language discussion I'll respond. Some of your points are straight out invalid.

    Technically you can. I wouldn't suggest doing it as normal practice though. Interaction between languages gets messy.

    Incorrect, used properly there is no speed difference between the languages. Both languages sit on top of the Mono/.NET framework. Both compile down to IL and produce the exact same build output. There are reasons to choose between the two languages, but speed is not one of them.

    They are written this way because that's the language they were originally written in. Its a case of not taking the time to translate the scripts, rather then because either language is better at.

    Forgive me for pointing this out, but this disclaimer pretty much explains most of your post. In general your advice is not the same as someone experienced in coding with Unity would give.
     
    tanoshimi and Dantus like this.
  6. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Back on topic: Just checked out the asset on the asset store. A few more points to consider.

    • The asset is brand new. This means there may still be bugs present.
    • There are no reviews or ratings. If you try it, be sure to review it.
    • The publisher's website is a google group page. Make what you will of this, but it doesn't appear to have a decent team supporting the asset.
    • There is no online documentation, there might be documentation in the asset, but it doesn't look like there is much.
    • The publisher has no other assets on the store.
    Its entirely up to you. $20 doesn't seem like much of a risk if the asset cuts your development time down. If you want to code in actual JavaScript I would suggest buying the asset and playing around with it for a couple of days. If it takes any longer then that to get coding you are better off biting the bullet and learning regular UnityScript or C#.

    Where this asset (or something like it) could get powerful is in bringing regular JavaScript libraries in to Unity. Its not clear if this asset will do that.
     
  7. StrongGuy

    StrongGuy

    Joined:
    Aug 12, 2014
    Posts:
    13
    @BoredMormon Thank you for your reply, you are very kind:).
    Yeah, $20 is not much.
    I'll try to contact the publisher.
     
  8. StrongGuy

    StrongGuy

    Joined:
    Aug 12, 2014
    Posts:
    13
    @LDev77 thand you.
    I know most of assets in Unity are made in C#. The plugin says it can export 99% C# interfaces to JS.
    Unreal is a good engine, but Unity is my boss's choice.
     
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,398
    No, they compile to the same bytecode and are the same speed. There's no reason to avoid Unityscript if that's what someone wants to learn.

    --Eric
     
    Kiwasi likes this.
  10. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860