Can I use JavaScript to develop Unity games?

I would like to receive an authoritative answer to a question that has been a question for me for a while. The term JavaScript is often used to refer to or describe UnityScript.

They told me again and again that you can use actual JavaScript to develop games in Unity, however, from what I understand, UnityScript can at best be described as a superset of JavaScript, but there really are some elements that are possibly fully compatible, and you cannot just use JS, as usual, to develop Unity games, as you have to follow their conventions.

Am I really wrong? Can you actually use pure JS and its conventions directly to make Unity games outside of the parameters that UnityScript installed?

+5
source share
1 answer

Short answer: No, you cannot use PURE JavaScript. As far as I know, Unity uses its own JS-like syntax (some call it Unity JS), but it is most often called UnityScript.

Your question comes from the fact that the Unity community refers to JavaScript and UnityScript as if they were equivalent and interchangeable.

Although these views are very similar, there are some fundamental differences, such as class-based UnityScript, while JavaScript does not support classes.

You can definitely use the previous JavaScripting conventions that you have chosen in UnityScript, as applicable. The semantics used are slightly different - but I found that it doesn't take a lot of time to pick up the small changes.

Read more about this here: UnityScript and JavaScript

Happy coding!

+6
source

Source: https://habr.com/ru/post/1210511/


All Articles