- Home /
Using C# and Javascript in a project
Hi, I'm wondering if Javascript is a good langauge to use on a project, especially a Multiplayer project, would it be as good as C# and good to use, having a game coded entirely in Javascript, or would it perform worse than a game coded in C#?
I'm also wondering if you can mix C# and Javascript Together in a project or a gameobject without any problems. Could there be problems if you had a Character Controller and you used C# for the Camera and Javascript for the motor, or would it not work at all?
And for the project, if you had your server or your Multiplayer features coded in Javascript and then you change the language to C# for different parts of the game such as gameobjects, weapons and AI (Performance-Wise).
I'm new to scripting so I'm not entirelly clear on how things work yet. Thanks for reading!
Answer by testure · Jul 20, 2011 at 04:41 PM
what's the point of mixing two languages anyway? Just pick one and use it...
That said, you can mix as many scripting languages in unity as you want. I'd imagine that it would be a huge pain to manage though.
One scripting language isn't necessarily better than another... it all gets compiled down to JIT anyway. UnityScript does lack things like generics, and other abstract concepts of OOP, but chances are if you're asking this question, you probably don't need those things.
in the end- performance wise, they will all perform the same.
You can mix and match languages all you want.
For example, the Vector3 class is internally written in C#, but people use it in javascript, C#, and boo all the time with no problems.
The only thing you have to worry about is if everything compiles in the correct order.
http://unity3d.com/support/documentation/ScriptReference/index.Script_compilation_28Advanced29.html
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
this script in Javascript?? 0 Answers
Problem Javascript to C# 3 Answers
Javascript equivalent of an inspector C# public List? 1 Answer