hi im new to unity and im interested in how other people are learning to script.i am currently going through the basics things like variables…and once i finish then i want to go through game making tutorials, and i was wondering how other people are learning and what pitfalls to avoid,so how are you guys learning to script? thanks.
I actually started with scratch, so when I moved onto real coding I knew what I was doing. Then I just read through a tutorial grasped the basics an started programming almost immediatly. then when I don’t know something, I just look it up and I learn from other people’s scripts.
I would suggest starting with learncs.org, it’s quite a good tutorial
First I learned the basic structure and syntax after that I followed some unity specific tutorials because I wanted to code in unity. Most times I had no idea as to what the code did but I just copied it down anyways. After a while it started clicking to the point that I could do basic coding without the tutorials. After that it was a just matter of learning new trick and shortcuts.
I did not learn to code by any traditional methods. I started “learning” c# in a high school videogame design class that used unity. All I was to do was to copy down the code and make sure it worked. At the time I had no idea as to what it meant, but in my free time I would sit there and try to figure out how the code worked and what made it work.
learning to code is similar to learning a new language. It will be difficult at first but after a while it comes naturally and you will be able to apply the knowledge of one scripting language to another and learn it quickly.
I learned C# from the Unity learn page. Programming I’ve mainly picked up via osmosis as and when it’s needed.
The fact you mention variables as a learning point implies to me you have not gotten very far with your study of C#. I highly recommend learning C# outside the context of Unity first. I will add to what @gorbit99 has said and say, learn everything under basics in http://www.learncs.org/ and you should be good to start. You will always have more to learn even with those basics so keep yourself curious on how to do things more efficiently.
I actually started with ActionScript3 from Flash, but transitioned to Unity and learned C#. Learning both languages allowed me to see the smililar concepts between the two languages, and from there allowed me to apply my knowledge to other game engines like the “Love” game engine that uses Lua, and Godot which has it’s own custom scripting language(although they seem to be working on putting in C# for use too).
@Laperen Variables are actually the second scripting lesson in the Learn section here: Variables and Functions.
@mushey I recommend that you follow these scripting tutorials I just mentioned beginning with Scripts as Behaviour Components, alongside with practising by making the tutorials in the Learn section, beginning with Roll a Ball or it’s 2D version 2D UFO Tutorial if you are more interested in 2D games.
Once you have made the tutorial, take some time and try and remake it from scratch without referring to the videos and lessons. ![]()
thank you all for sharing your story and yh @ i think after finishing the basics i will go through the game making tutorials and try to make them from scratch aswell.
I got my start with catlike coding. It was a good place to get fimiliar with code structure and why the hell you have to type what you have to type to make things work.
After that, it was all about googleing what I needed as I needed it.
I learned through the MSDN documentation and tutorials (linked below). That being said I already knew C++ and .NET so picking up C# for me wasn’t anything like it would be for someone with no past programming knowledge. There might be something useful in those tutorials for you but keep in mind they’re not made for Unity.
Though they might be good for someone learning C# by itself with books like the free C# Yellow Book.
Or the free Fundamentals of Computer Programming with C# book.
I’ve written databases in other languages for about 25 years, so I had a pretty good basic understanding of programming. I just started picking up C# and I found that www.udemy.com has a pretty good course in learning Unity that starts with scripting. In fact it mainly concentrates on using scripting for all of the necessary Unity functions. The courses are a little spendy, but if you watch their course list, they often have sales where you can pick up a good course for USD $10. They also have some pretty good C# courses that really dig into the nuts and bolts of the whole .net scene.
I’m actually learning c# from the unity game tutorials section and from a few
c# beginner tut vids, on YouTube. It’s really kinda fun.![]()
Like @Ryiah I already knew how to program in other languages so I never really “learned C#”, I just kind of picked up the different nuances while going through Unity game tutorials. Thus you might consider learning programming with some other free resource (like codecademy.org) and then come back to Unity after doing that for like a week.