Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by user-9668 (google) · Feb 24, 2011 at 09:43 PM · javascriptjavajava-is-not-javascript

Java or Javascript?

Hi everybody,

I am very confused....

I have been learning Java for weeks now and I am starting to make first plans for my future game.

BUT then i read an article about Java where somone said that Java and Javascript are two completly diffrent languages ....and the cofusion began...

Then I opened Unity 3d and i saw Javascript and i had the feeling that all the work I have put into Java is nothing worth now.

So to come to a point What is Unity using, Java or Javascript? Or should I switch to C# to avoid confusion?

Note: I do not have a whole lot of scripting expierence and I am actually pretty new to all of this. (besides some Java) Sorry for my bad english. (English is not my first language XD)

Thanks

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Feb 24, 2011 at 09:52 PM 3
Share

Learning Java doesn't mean the work you put into it is worth nothing. Learning to program is worthwhile in any language, since most of the concepts are the same even if the syntax isn't.

4 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by Peter G · Feb 24, 2011 at 09:49 PM

Javascript and Java are not closely related by any means, and unfortunately for you, Unity uses javascript. AFAIK (I wasn't even born yet) calling it javascript was just a marketing technique to make it more appealing.

If you think that you have a good understanding of Java, then C# will probably come easy to you. They are both strongly typed with similar syntactical rules. Not to mention that C# has more language features than javascript. But, Unity's implementation of Javascript is more class orientated than web javascript so if you are familiar with the principles of OOP then you will find that learning another object-oriented language won't be that hard if you do want to learn javascript.

I would suggest searching the forums and answers because there has been much debate over js or C#. More people use js, but C# has some more advanced features and the type safety makes it more difficult (not impossible) to write sloppy code. Either way though, you cannot write in Java, sorry.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image user-9668 (google) · Feb 24, 2011 at 10:06 PM 0
Share

Thank you very much! You have given me some great advice. Can you answer me on last question please....Is it hard to learn Javascript starting as a total beginner?

Thank you very much.

avatar image Peter G · Feb 24, 2011 at 10:15 PM 1
Share

That's what I did. then I switched to C# for a number of reasons, but learning program$$anonymous$$g concepts is almost more important than the syntax of a language. You should be able to pick up Javascript fairly quickly.

avatar image
3

Answer by tertle · Feb 24, 2011 at 10:26 PM

java is completely different to javascript, common mistake.

Lucky for you though, that c# has pretty much identical basic syntax to java so just use that. Obviously a few language specific features but the fundamentals are near identical.

I would suggest using c# over javascript for unity anyway, even if you know both languages.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by _Petroz · Feb 24, 2011 at 10:05 PM

I made this mistake when I first started Unity as well. The other answers seem to have it covered, there are a few amusing answers on stack overflow for a similar question:

Java and Javascript are similar like Car and Carpet are similar.

  .

One is essentially a toy, designed for writing small pieces of code, and traditionally used and abused by inexperienced programmers.

The other is a scripting language for web browsers.

Taken from: http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by ThumbStorm · Feb 24, 2011 at 09:48 PM

Unity uses javaScript(which is technically called UnityScript). Java and javaScript are two different languages. Don't feel bad though, I went through the same thing. I learned the JavaScript language for Unity and found it very easy to pick up and there's more documentation on javaScript in unity. Good Luck!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

yield WaitForSeconds(); issue--very specific, apparently 2 Answers

Need a link to a Machine gun Script Please 1 Answer

Unity Javascript 3 Answers

When in game, sound is really strange. Help Please!? 2 Answers

oescape script name? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges