- Home /
Where can I find C# tutorials for a absolute beginner?
Hey All, I wanted to ask where i could find c# tutorials aimed towards the completer beginner to unity and scripting. I have no scripting knowledge and am completely new to unity. I have tried loads of tutorials but they just dont explain what the code means and how it works. For example, I read the catlikecoding.com clock tutorial, and i fount it very nice in the beginning but after wards i didnt know what things like bool and some other things mean and why they were placed in such format. Are there any tutorials that explain the whole concept properly? Thx in advance.
Why C#...why not JS? It's easier, more widely used, more tutorials available for it, etc.
JS gets dirty in less lines of code... And is not actually such a widely used language (at least not the $$anonymous$$ono version)
JavaScript may be more widely used, but we aren't actually talking about JavaScript; Unity uses UnityScript, which is subtly different and much less useful outside of Unity. And porting "native" JS to unity will probably cause more headaches than its worth.
Whether is will be "easier", will be quite subjective. I personally have very limited experience with JavaScript (even less than UnityScript, which I have only touched because sometimes people ask questions in it and I try to help), but have not heard many good things about it as a language. Either way, it has rather unusual syntax.
By the way- I hope by "easier" you don't mean "don't have to bother deciding your variable types/declaring", in which case you're setting yourself up for lower performance and a world of hurt when you do a typo like "hello" as "heIIo", or a hard to spot typo (reciever?) in a variable name. (I know about pragma strict, but if this is the drive of the argument then using pragma strict scuppers it)
The AssetStore assets I've used (EZGUI, NGUI) have been written in C#, and although I appreciate two (rather widely used) assets isn't much to base it on, I have heard that that is the norm.
Just to add that you can't use JavaScript duck typing on mobile devices either, you have to use #pragma strict for iOS etc.
@Tarlius yes I realize that it's UnityScript, not JavaScript, still the same syntax. And of course I use pragma strict and declare my variable types and such. But surely you agree that there are more tutorials on the web for UnityScript than for Unity C#. The fact that AviGamer is asking this question shows that there are not many C# tuts anyway. You know?
Answer by xandermacleod · Jun 20, 2013 at 04:53 PM
www.3dbuzz.com was the friendliest one for me, it did a lot of hand-holding. Once you gain a little bit of experience with C# "BergZurg" is one of the better ones for later on.
The most important thing to do in my opinion when you are learning coding is to have small bite-sized projects in your head you would to solve. Things like, "how can I get this cube to move from over here, to over here". Little questions that over time build up your knowledge base. Dont worry about bad habits, dont worry about making mistakes. Everyone has bad habits, and EVERYONE makes mistakes. Most of all, if your not sure if something will work or not, try it out. It's very common for people to not even test if something will work because they dont want to put in 'wasted' effort. We all make mistakes, even the 'super coders'; so dont be afraid of 'not knowing'.
:)
Answer by Tarlius · Jun 20, 2013 at 12:24 PM
You might find yourself overwhelmed if you try to understand everything from the get go. As a true beginner you might find it easier (and more interesting) to to just follow along and pick it up as you go, and try things out when you get the chance. Messing with code other people wrote is imho a large part of the learning. A lot of programming (especially early on) is done by finding something that does something close to what you want then hacking it to make it do exactly what you want.
When the compiler spits out massive lists of issues with your code, two pieces of advice:
Start with the first one (in most cases, the top one will be the cause of the next few/all of them)
If you can't see anything with the line its saying is wrong, check the line above (if you forget a semicolon its usually the line below that causes an error)
By the way- if you don't know what a bool is yet, I suggest googling "c# primitives". Adding the primitive "words" to your "vocabulary" will let you read a lot of code :)
As for the rest... Well, you'll probably never meet a programmer who knows all the standard libraries without looking them up. But then equally, you'll probably never meet someone who knows every word in their native spoken language. Knowing how to look things up (google, unity/C# documentation) is a vital skill. The unity documentation is very thorough for unity code, but the C# stuff you'll want to get familiar with the Microsoft* documentation.
When you get completely stuck, and you've read the documentation for the functions you're trying to use, there are places like here to ask for pointing the the right direction.
*Unity actually uses the Mono implementation of the C# language but as a beginner you probably won't have trouble for a while.
Answer by bruce965 · Jun 20, 2013 at 12:54 PM
http://unity3d.com/learn/tutorials/
Good luck!
I think the biggest problem with all the "do it like in the video" tutorials is that they never show you how to start with you own ideas, which is the most difficult part in my opinion.
But dont get my wrong, those are very good tutorials in which I learned a lot myself. It is exspecially good for learning the interfaces and how to work with specific components of a game.
Lessons in this section should be suitable to learn how to code in Unity.
http://unity3d.com/learn/tutorials/modules/beginner/scripting
Answer by Xazas · Jun 20, 2013 at 01:09 PM
For learning C# in general as a beginner I highly recommend Bob Tabor's tutorial on Microsofts Channel 9.
http://channel9.msdn.com/Series/C-Sharp-Fundamentals-Development-for-Absolute-Beginners
It might be a bit to basic if you already have a programming background but in this way it is sure that nothing importand is left out and it is very easy to understand and to learn. I would recommendt to learn the basics of the language first and after that how to use it in Unity.
For learning how to use C# in Unity a good way(at least for me) is to follow this steps:
Make it clear to yourself what your function/script/behaviour should exactly do.
Translate this into a code-like format (pseudocode).
Translate your pseudocode in actual C# code.
See if it realy does what was inteded and resolve any errors and mistakes.
At Step 3 and 4 use any resource you can find, forum, unity answers, google search and most importand the scripting reference. Sometimes you have to go some stepts back, see this list more like a circle you have to go throug again and again until the outcome is what you want.
That is the way I am learning everything for the last 3 month. The most difficult part are the first stepts on your own project. Those take a lot of time, but if you dont give up at that point you will get more and more fluently in writing scripts with every function you get to work.
Your answer
Follow this Question
Related Questions
My Debug.Log won't show on the console? 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Get Rigidbody2D component in script (c#) 1 Answer
Raycast won't collide :( 2 Answers