droman07
droman07

Reputation: 127

Is there a difference between JavaScript and Unity JavaScript (UnityScript)?

I'm going to start scripting in Unity3D pretty soon for game development using UnityScript (since I am a beginner). If I had experience in JavaScript (which I don't), will I find UnityScript any different? If so, how much of a difference is there between these two scripting languages?

Upvotes: 4

Views: 2107

Answers (1)

CodeSmile
CodeSmile

Reputation: 64477

This is summed up in the tag wiki here: https://stackoverflow.com/tags/unityscript/info

Main differences:

  • UnityScript has classes, JS has no concept of classes (yet)
  • The filename of a UnityScript automatically puts the code in a class of that same name (minus the extension)
  • No global variables in UnityScript
  • In UnityScript, this is always the class pointer (aka self)

Specifically this link tells you all about the differences between JS and US: http://wiki.unity3d.com/index.php/UnityScript_versus_JavaScript

Upvotes: 6

Related Questions