How to change from C# to JAVA?
I am working on a project for school in which we can do anything we want, in whatever language or so i thought. I decided to make a game in which you roll a marble around a map and interact with other players (only 4 players) until some player reaches an end goal. The problem is that my teacher now says i cant use C# so i will need to change it to JAVA, the problem with that is that i do not want to translate it by hand because honestly i am to lazy because it would take forever. So i need to know if i can bridge the code from C# to JAVA and how? Thank you
Answer by Dave-Carlile · Mar 28, 2017 at 08:25 PM
You can't use Java because Unity doesn't support Java. Do you mean Javascript? Technically Unity doesn't support that either, but a similar language called UnityScript.
The syntax differences are fairly small and shouldn't take too long to convert by hand. I would ask the teacher why? UnityScript isn't supported much in Unity anymore. C# is most definitely the way to go.
If this is a school computing project, I very much doubt that "Unity Javascript" is a permissible language but C# is not ;) It seems much more likely that the OP really has to use Java, in which case Unity is out.
Answer by Joe-Censored · Mar 28, 2017 at 09:21 PM
Unity doesn't support Java, so can't be done in Unity. Did you mean JavaScript? JavaScript and Java are two entirely different languages.
Answer by FlyingHighUp · Mar 28, 2017 at 09:18 PM
Converting C# to Java is simple enough. Just copy and paste, replace properties with Get and Set, get rid of usings and replace them with imports.
...But chances are most of your code is useless without the Unity API (Vector3, Monobehaviour etc.) . Talk to your teacher and try to work something out. Otherwise RIP Op. May god have mercy on your soul.
Answer by Epster · Mar 30, 2017 at 05:33 PM
Thanks does anyone know if i can convert to python then?
Unity supports JS and C#.... not Python, not Java, not Perl, not C++, not VB..... JS and C# are your choices.
Actually, I think Unity secretly still supports Boo, - or at least a subset suitable enough for a simple game.
It has virtually the same Syntax as Python, so maybe for future reference.
Your answer
Follow this Question
Related Questions
Convert Java to C# 1 Answer
Issues with c# script, minor error that I am unsure how to fix 1 Answer
Java to C# Translation 1 Answer
JavaScript to C# 1 Answer
NPC Wandering Intervals/Gaps Help! 0 Answers