Hi, I want to start learning javascript so I can use it with unity. I don’t know where to start and it just seems so complicated. Anyone know a good place that teaches it well?
You should take a look at this.
I fear that this will just confuse him even more.
There are quite a few Unity books out there. Most of them uses Unity’s Javascript.
Another good start is here: Unity - Manual: Creating and Using Scripts
I don’t know, I think it’s a good idea to learn right up front that ‘unityscript/unity javascript’ is NOT the same thing as ‘javascript’ (and maybe even that javascript is not java either…).
Otherwise it might be confusing down the line when they’re wondering why real javascript and unity javascript aren’t interchangeable.
And then of course, there’ll be the usual suggestions to not learn unity javascript, and to learn C# instead.
Happy to oblige. Unless you have a good reason to learn JavaScript then C# is better. ![]()
Either way the scripting tutorials in the learn section are a great place to start.
But which one is easier to learn. I have no experience with either.
Then go C#.
C# will take you about half an hour longer to get comfortable writing scripts. Its slightly more difficult to learn from scratch.
JavaScript will take you hours to debug the various typing issues present in the language. Its easy to start learning JavaScript, but its more difficult to learn to use JavaScript properly.
Agreed. And this goes for javascript in general, not just unity javascript.
Javascript, in my opinion, survives on the fact that it’s SUPER easy to pick up and learn and get coding immediately.
BUT, as your code grows, it because unwieldly and crazy to chase down all the strange bugs that crop up from the loosey goosey nature of it. Making mastering it harder.
C# has a steeper learning curve up front, but javascript’s curve quickly becomes steeper as you progress.
But then as you get into the more advanced parts of C#, accomplishing certain tasks become a ton more easy. The complex design stuff can be accomplished with very little effort in the language. Stuff that with out the already gathered up skills from coding with it wouldn’t make sense. Stuff that doing in javascript becomes unholy complicated, to near impossible (I mean it’s technically possible, just so absurdly obtuse that you wouldn’t even do it).
Welcome at the language faith war again. And as usual filled with nonsense and myths.
I haven’t found a single thing yet that i couldn’t do with Unity JS. And when it comes to Unity tutorials, there are still more Unity JS tutorials and books around.
Fact is, you can do the very same game with both languages. It will run in the same speed, it will look equal, and you will need roughly the same time to develop it. Some things goes easier and faster in JS, some things goes easier and faster in C#. And you cannot say which game was made with C# or JS afterwards.
Switching the languages is not really a big deal once you have learned the concept, and in case there is really a need to. So the more important question is: which language is easier to use for Noah 492 to learn this concept. And he explicitely asked for JS advice. Not for somebody to convince him to C#.
So we actually agree to a degree.
I said JS was easier from the get go, for the beginner. You say the same thing.
I said that there are things that in the more advanced cases near impossible, or are convoluted to perform in U/JS. You not only agreed, you gave an example!
I said that C# is more difficult up front, but is easier in the long run. You don’t deny this at all, and nearly imply that you agree by saying that most users making just a “usual game” won’t run into these issues.
I don’t care if you use U/JS. Hunky doory, that’s your choice.
I merely stated the other option, and highlighted reasons why.
You AGREED with those reasons.
You just come to a different conclusion based on them.
Guess what… OP might come to their own conclusion as well.
Whose faith war is it again? Because it ain’t mine, C# is one of 26 languages I write regularly. I don’t really have much faith to just C#. Shit… I write javascript (regular javascript) quite often.
Then you should know that a language is just a tool. But still you hijack this thread to try to convince the poster from C#, unasked. And this thread hijacking of JS threads to get a word placed about C# and that it is so much better is some kind of e-sport at this board. And i find it highly disturbing.
He already did. This thread was about where to get help for learning JS. Not what language is better.
Two deleted messages later we have some loose ends, so …
The named example here was that i needed to grab and use a MSDN C# code to call a Windows file browser. And i also stated that this is not a JS problem, but a Unity limitation, since Unity’s Runtime does not offer an access to Windows File browser at all. Unity is a Mono based multiplatform game engine, not a Windows C# ide.
I have seen this thread before…
Anyway, I switched to C# because importing certain assets with JS can be a real pain. The cool assets seem to be written in C#.
Tiles he was objectively looking at it, also some other ups for C# is that C# skills learned for unity are useful outside of unity as well since it is a standard programming language used for many things.
In the end its just a tool, I work with many programming languages as well, and sure I got my favs but your also not going to see me pushing for python to be used somewhere when I know a strongly typed language would be better for said use, or vice versa.
In the case of unity I objectively think that C# is the better choice being a real language with its own set of resources, access to 3rd party libraries that can be integrated and because of some of its features like events, delegates and interfaces lend them self’s well to game programming.
Not to mention the added confusion of unitys js acting nothing like what js is elsewhere, since in unity it is class based with typing in a explicit manner vs if you are familiar with it from the web. It approaches OOP in a very different way with prototypes and typing is rather implicit
And again we have a thread that started as a question about Unity’s Javascript and turned into a C# is so much better dude thread. Full with myths and untrue statements to let C# shine. This is really sad.
No untrue statemeants I mentioned some things C# can handle better, there are a few for unityscript as well like its less verbose way of dealing with coroutine’s.
Well, i could start a debate now where imho the untrue points are, which are by the way not necessarily told at your end, and we could go on with the eternal debate what is better, JS or C#. It exists since the two langages exists.
But that’s exactly what i complain about. This thread is hijacked now.
This was initially a thread where to get learning resources for Unity’s Javascript. Now it is a thread how well C# is, and why folks have switched over. And any further searcher will find everything but a useful answer to the question where to get learning resources for Javascript.
I have seen this pattern here again and again. A question about Unity’s Javascript comes up. But instead of an answer to the question folks jumps in and declares C# as the better language. And makes any further useful answer impossible.
It looks like this thread is hijacked primarily by your complaining.
I have answered the initial question right at the beginning. But i haven’t seen you answering the initial question yet. Just your C# blah blah and your attack here now.
So who is hijacking here?
I actually wonder if this is the case anymore. I don’t remember the last time I found a blog post or tutorial that was written in UnityScript.
People are simply offering suggestions - you’re welcome to do the same instead of accusing everyone of being a part of some grand anti-UnityScript conspiracy. Maybe it’s just me but it feels like the only threads in the Scripting section that you contribute to are ones like this - so the prophecy seems self-fulfilling ultimately…