The doc page Matthew linked to actually explains it in more detail, including why putting a script in Standard Assets works the way it does, and how you can avoid having to put C# scripts in Standard Assets in some cases, by using GetComponent and dynamic typing in Javascript.
UnityScript used to be called “JavaScript” due to an impressive amount of shortsightedness on Unity’s side. It’s still referred to as “JavaScript” in a bunch of places, but they’re getting better at it now.
Let’s be honest: It was named “JavaScript” to dupe people who’d done web development into buying Unity. The name JavaScript is a marketing lie and nothing more. And I’m not willing to use the past tense on that because it’s still not referred to as UnityScript in any marketing materials at all - only in documentation. So they’re still duping web developers with the name.
Agreed. Still duping web developers. I am a web developer. It’s easier to learn UnityScript than to try downloading/installing the Android Studios, and Unity is free too, so here I am. At least I have the aptitude for learning new languages. By the way, it’s still called Javascript when you go to create a new script.
Though the more UnityScript I learn, the more it seems like it would be easiest to just switch over to C# entirely. UnityScript is the hellspawn of C#, JS, and Satan. Nothing I like about JS (which is also included in PHP) is there. There’s no loose typing. There’s no dynamically created indexed arrays Well there is, but it’s broken. If you try to access param1.minimum you get an error unless you specified that param1 could have a minimum. So you have to typecast everything anyways, even if you typecast it as a JavaScript Object. And then the syntax for typecasting is totally different from every other forced-OOP language. Typecasting upon declaration requires even more repeated words than forced-OOP languages. All the namespaced functions I’m used to, like Math.min(), Date.now(), etc. are gone. Wiped off the map. Replaced with the same namespaced functions I’d be using in C#, like Mathf.
But it makes sense that they can’t possibly let you use JS in the same way they let you use C#. Although loose typing is wonderful, it doesn’t play too well with strict typing. And it would have to be compiled an entirely different way. UnityScript, as far as I’m aware, compiles to the same exact code that C# compiles to. So I’ll be switching over to C# (I only have 4 scripts as part of the 2D Roguelike tutorial so far). To think! I found C# intimidating. I think UnityScript does have one benefit from being called JavaScript. People are more willing to try it, even if it completely shreds their hopes and dreams for a few days (or weeks, depending on how fast they pick up on the fact that it’s different). I think C# could stand to have some more readable documentation. It shouldn’t be intimidating. But it is intimidating.
On a side note, I didn’t realize you could buy Unity. I mean, I guess I did see something about fees, but that’s only for large companies that could probably hire more than a web developer, right?
It’s a requirement to pay for one of the subscriptions if you earn enough. The cutoff is quite high, if you make over $100k a year you have to go with the $35 a month plan. There’s some benefits to paying too, but nothing on what you can do with the engine. See here for details.
I don’t think mine works that way. Standard Assets folder in the Assets folder doesn’t seem to help. It didn’t exist, so I made it, corrected typos, added blank, and I am still getting the same Error. Any guesses?
Another solution that doesn’t require moving anything around is to use an import at the top of the javascript (the same thing as C#'s “using”), such as import UnityStandardAssets.ImageEffects; or import UnityEngine;.