Which language should I learn?

Hi, I’m new to Unity, and programming in general, I was wondering for someone totally new to programming, and wanting to make iPhone games, which language should I learn, Java Script, C# or Boo. It seems that JS is the mostly used language.

Also, whats is the best place to start learnig the best language. Any links to some good Tutorials/ Video tutorials? I have browsed a lot of the info on the Unity website.

I have plenty of experience doing art and 3D, but I’m new to coding.

Thx for any info you guys can throw my way!

The majority of the unity documentation features only javascript examples, so you’ll probably find it easiest to pick up. As for general javascript syntax, you might be amazed at how much you can pick up just from referring to examples in the docs, and hanging out in the scripting forums here. I too was a total programming novice before picking up unity. For a small handful of things (like how to deal with strings, or do a for loop) I ended up resorting to google, but other than that I learned most of the fundamentals of javascript from examples in the unity manual.

Hey Shanesta,

I do agree. Javascript is the way to go for a beginner in Unity for the reasons cited above.

However, there are two things you need to know prior to learning a programming language if it is directly aimed at coding for Unity.

1/ You should learn the basics, which apply to all popular high-level programming languages: Variables, Control Statements, Functions etc…
2/ You will need to get familiar with the Unity API (Scripting Reference Tab in the documentation), as Javascript in Unity does not necessarily share Javascript for the Web’s API.

If you are learning Javascript in a different context than Unity, I strongly suggest you then take a look at the following link:
Head First into Unity with JavaScript

Hope this helped a bit, and good luck! :smile:

I would also agree to Javascript, and the methods described here are exactly what you should do. Google to learn about variables, functions, etc then start ripping apart example code from the forums and Unity docs.

I set out to learn to code about 9 months ago, so I’m still very new to it. But a lot of that time was spent trying to conquer Objective-C, which left me confused and crying in a dark closet. I also took a detour into Torqescript land eventually found my way to Javascript via Unity. Out of all of these, Javascript is by far the easiest way to learn to code IMHO.

Plus, you couldn’t ask for a more helpful place to learn.

Thx for the info guys, I started doing this tutorial
http://unity3d.com/support/Tutorials/2%20-%20Scripting%20Tutorial.pdf

All was going good, but when I get to section 6, and make the Switch script, which is…

var switchToTarget : Transform;
function Update () {
if (Input.GetButtonDown(“Jump”))
GetComponent(Follow).target = switchToTarget;
}

I get an error, ‘target’ is not a member of ‘UnityEngine.Component’

I’ve followed the tut exactly, but get this error, is it because I’m using Unity iPhone Advanced, and this tut was for regular Unity?

Thx for the help Guys.

It’s because iphone uses strict typing. You need to actually cast it as a specific type before you access one of the properties.

So instead of

GetComponent(Follow).target = switchToTarget;

you’d have to do something like this:

var follow : Follow = GetComponent(Follow);
follow.target = switchToTarget;

I personally dislike Javascript as I’m a C++ guy, but I have to agree, for learning, I’d definitely recommend Javascript. C#, while extremely useful to learn, is much more idiosyncratic. The only real argument I can give in favor of C# is that you can use the incredibly good MSDN docs to look stuff up. But you’ll need to look up a lot more with C# than you would with Javascript.

For someone who’s already comfortable programming, I’d encourage you to go with C#. But otherwise, definitely go with Javascript.