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 Kieron_Wiltshire · Dec 23, 2013 at 02:24 PM · gamecreate

Is it possible to create an entire game using javascript?

Hey, I've been programming for a while mainly in Java but my question is, would it be possible to create a game entirely using JavaScript or would maybe C# be used for maybe things like MySQL databases or something to store player data maybe?

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 KellyThomas · Dec 23, 2013 at 02:40 PM 0
Share

If you are familiar with Java then you should find the transition to c# the easiest. I would only recommend UnityScript to people most familiar with ActionScript 3.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Statement · Dec 23, 2013 at 02:27 PM

Yes, it's possible to create an entire game in JavaScript (UnityScript)

There are some differences between the languages but to my best knowledge you can still use all the API's regardless of language choice. There may be rare moments where doing something in UnityScript may be harder than C# but I wouldn't let that deter you if you feel that UnityScript is a better choice for you overall than C#. If you prefer UnityScript and if you feel the syntax is familiar for you, go for it.

However, with my limited experience in Java (not JavaScript), I think that you may find transition to C# pretty easy since the languages are pretty similar in structure and syntax.

You may find this page helpful too:

  • Transitioning between Java and C#

In the end, common libraries are the same and the language choice is mostly a matter of preference. You can't do some things with UnityScript that you can with C#, such as using extension methods. On the other hand UnityScript excels over C# when it comes to terse coroutine syntax. This is just mentioning two differences, and there are of course several. None of these will stop you from writing any code and you should be able to achieve the same goal with either languages.

If at all uncertain, give each a try. Try making a simple component in UnityScript and in C#, and see which one follows a syntax convention that you prefer the most.

Recommended topics:

  • How should I decide if I should use C#, JavaScript (UnityScript) or Boo for my project?

  • What are the Syntax Differences in C# and Javascript?

Comment
Add comment · Show 5 · 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 Statement · Dec 23, 2013 at 02:48 PM 0
Share

If you were to ask me for advice and let me be subjective on the topic, I'd say you'd be better off in the long run learning C#. In the short run it may stagger you as several of the examples in Unitys docs are in UnityScript only, but if you know program$$anonymous$$g you shouldn't have that much of a hard time figuring it out. The question is only how long it will take you and how soon you need to be productive. Also I think you'll see a lot more widespread C# usage if you were to work at a company using Unity. Learning C# also gives you a "carry with you" skill that you can apply elsewhere, where UnityScript is specific to Unity only. New programmers can benefit from learning UnityScript if they find it easier to learn, at least the get the "carry with you" skill of learning a program$$anonymous$$g language, and so if they transition to another language, they can still apply a lot of their knowledge to ease the transition.

avatar image Kieron_Wiltshire · Dec 23, 2013 at 03:07 PM 0
Share

Thank you for the advice! I know in Java when you create objects you can implement them and extend them, is this possible in C# and UnityScript? and also is it possible for example to create an object lets say a magic spell, is it possible to get the attacker of the spell and check if the spell hit's another player using these objects, for example:

 if(spell.hit(player)){
     spell.getAttacker().giveExp(5.57);
 }

which language would you recommend me to create objects which I can check things like this? UnityScript or C#?

Thanks again!

avatar image Statement · Dec 23, 2013 at 03:21 PM 1
Share

Yes, you can extend and implement classes, abstract classes and interfaces. However, once you get started with Unity you may find yourself doing less of that than you think you need to due to the component design of the engine. There are still places to do that but in many cases it's not necessary. It may take a slight mental shift to get used to this way of thinking but it is really nice to work with once you got the hang of it.

Both languages should be equally good at doing what you just described.

Note that extends and implements are used in UnityScript where : is used in C#. The syntax is a little different, but it achieves the same thing, just with fewer letters which can improve or reduce your readability, depending on what flavour you prefer.

 // C#
 public class Foo : Bar
 {
 }

 // JS
 public class Foo extends Bar
 {
 }

 // C#
 public class Foo : IBar
 {
 }

 // JS
 public class Foo implements IBar
 {
 }

I invite you to read the links I sent you as they should help you get a broader picture. Also you'll find a lot of discussions if you put just a little effort searching here. I am not telling you to RTF$$anonymous$$ so please don't take this as a diss or that I am too important to care, but there is a wealth of nice questions and answers readily available (for example I just looked up extends and implements myself to answer your question by searching for unity javascript interface in google). A general tip when it comes to Unity specific questions is to use google and prefix your question with unity or site:unity3d.com

avatar image Kieron_Wiltshire · Dec 23, 2013 at 03:25 PM 0
Share

Thanks so much for your help!

avatar image Statement · Dec 23, 2013 at 03:31 PM 1
Share

You are welcome!

While I don't want to milk you for $$anonymous$$arma points, we who answer questions would prefer if you also took the time to upvote the answer if you found it helpful and accept the answer if you deem the answer to also be the most correct answer presented to you. There is also a short tutorial video on how to best use Unity Answers.

By giving good contributors $$anonymous$$arma, those users are granted access to moderate the site for the better of the community. In my case, I desire all the points I can get to shamelessly try and catch up with @Eric5h5 ;) (Even though I know that is never going to happen). It also makes me feel like I've achieved something.

avatar image
0

Answer by Kieron_Wiltshire · Dec 23, 2013 at 08:22 PM

I don't have the option to 'covert to answer' or whatever on your answer? only on mine?

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

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to make out like little notes? 2 Answers

paid request 1 Answer

I'm completely lost with android 2 Answers

How do you create hotkeys in your game. 1 Answer

I need help with a companion!!! 2 Answers


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