How good are the Unity scripting tutorials?

Hey,

My name is Alexander and I’ve been using Unity in my spare time for a few years. I’ve created a few assets (some still waiting to be published) and these were all programming-related. Before January 2017, I had never taken any programming courses in real life. I did follow an online introduction course to Java (on Udemy), I downloaded the c# yellow book and read a few chapters, but I became bored (with bored I mean more like 'wanting do actually do something instead of reading a book) very quickly so I never really got past the first few chapters. Because of that, I only learned the basic things like variables, loops, classes, etc., and it never really got serious. After I became bored, I discovered Unity and I started playing around, I did the ‘roll a ball’ tutorial, learned how to manipulate the transform of an object, create objects, etc.

After that I started working on a project for an asset and I learned more in depth about specific things that I needed for that project (coroutines, ray casting, making your own functions instead of only Start() and Update(),…). I finished this project and started another one, where I learned about editor scripting, GUI scripting, editor windows, etc., and that’s where I’m at now. The problem is, that now I feel like I’m stuck, in terms of my programming abilities. For example this is the process I go through:

1) I want to create a certain feature for my asset
2) I write down the logic of the code that I’ll need to create in order to create that feature
3) ???

I strongly feel like I’m missing some of the fundamental things that another person would learn by enrolling in a programming class. I have a good sense of how I should achieve something by code (that is, the structure/the logic behind it) and I have no problem with using the API, but I feel like I don’t have enough knowledge about programming.

I took a class this semester where we learned about programming, and it certainly thought me some of the discipline I should know about if I want to become a programmer. We learned about how to create an algorithm in a constructive and professional way, iteration vs. recursion, time complexity,… And I feel like I really need those things in order to progress in Unity.

My actual question for you is, what should I do in order to progress further? We don’t have programming next semester and I want to learn more. Is it a good idea to just follow all the Unity scripting tutorials? Should I first read a whole book about C# and leave Unity out of it for now and learn about pure programming? The core of this question is, what order should I learn in?

1) Learn C# programming then apply it to Unity
2) Learn C# programming by following Unity tutorials
3) Work on a project and when I’m stuck on a certain aspect, figure out what I need to learn in order to progress and look information up about that

I appreciate all the input I can get.

Alex

You shouldn’t learn C# programming. C# programming - normal C# programming follows practices that do not work too well when applied to C# in unity, where it is used as a scripting language. With that in mind, yellow book on C# won’t help you much.

What you should do is to find an extremely fun problem, work on it till you get stuck, and then figure out how to get unstuck by looking up missing information. Basically #3, except that the problem must be fun/interesting for you. This approach will give you highest retention of information, because “fun” + “importance” create strong memories.

Speaking of tutorial quality…
I think I watched roughly three unity tutorials total (let’s see… animator controller basics, roguelike in unity and using volume mixer in angrybots), and used manual for the rest. I think the tutorials are decent enough for a beginner.

Also:

Don’t write down the logic. Write the code. Code is logic and writing the same thing twice usually doesn’t make much sense. At least that’s the way it works for me.

1 Like

@neginfinity

That’s true for me too but in Uni etc. they go through the whole pseudo code thingy…

Thanks, that’s really helpful! Making sure the problem is fun, is definitely a good idea and I already try to apply it. For example I was learning about using toolbars in a custom inspector, and after I learned how to code it, I combined it with picking out cool little icons to go with it, the whole experience definitely was fun!

I’ll try to directly write the code instead! I’m still using my notebook though when I don’t have my laptop with me and something pops up in my head.

Thanks!

All of the above.

Try not to overthink learning it. Absorb whatever you can or need. Be a sponge. Unity is an API, the code you write is C# and some of it uses Unity’s API. Some classes you write may not even contain Unity-specific code. You can write entire libraries of helper classes and methods that solve problems that don’t really have anything to do with Unity.

In my opinion/experience the more interested you are in learning something then the more you will learn. I dislike reading books that cover everything but instead dive directly into whatever I want to make and fill any knowledge gaps by looking around online. If that gap leads me to some complicated thing that I know nothing about then at least now I’ve got vested interest in learning it and generally it becomes much easier to absorb.

I’m not a big fan of writing out lots of conceptual stuff. Chances are I end up finding better ways to do it - while actually doing it - than the block diagram so I try to just rough out ideas then flesh them out in code, then back up and update the architecture design when I get further along.

1 Like

None of the above.

  1. Is a poor approach. You’ll be back here in a second asking where the main method is, how to get input from a console, or why your code is thrashing the garbage collector. You’ll be wanting to implement your own dependency injection system, railing against Unity reserving the constructor of Monobehaviour, and generally trying to do things in a way that doesn’t fit with Unity.
  2. This is decent. The scripting section tutorials are fairly good. But they are fairly basic. They will teach you all of the syntax and keywords you will need, as well as the basic Unity API. But they don’t ever get very advanced. Its seldom they touch on real world scenarios.
  3. This works. But you’ll often find yourself repeating the same inefficient techniques, even when there are better ones available. You can solve every problem in programming with enough if statements. That doesn’t mean its a good idea to do so. You’ll also find that you tend to set yourself projects that you can solve with your current knowledge. Its hard to set your own exam.

I vote hang out in the scripting section (or answers). Solve other people’s problems, look up the information they need. And then pay attention to the critique you get on the solutions you offer, as well as the solutions other people offer.

3 Likes

I think the best way forward would be through practice. Unity’s scripting tutorials are very good but if you already know the API they will be of limited value. And as others have pointed out, it’s only a subset of programming techniques that are required in the Unity environment, so learning programming separately won’t help an incredible lot either (though it certainly won’t hurt).

But more than anything I think you have to have the desire to experiment with different things. Over the months and years you’ll see a lot of Unity’s code, other people’s code, snippets on stackoverflow or whatever - and you’ll see things you don’t really understand even if you have a sense of what it accomplishes. Stop, run a few examples, learn about it enough to find out whether it’s a better way than what you’re doing, and worse case scenario you just learned something that might be useful in future.

I remember coroutines were something that I learned like this - I never used them and one day they came up indirectly in some code I was working with, so I said to myself “ok let’s figure out what these things do” and then I realised that all my timer based code (and a lot of other things too) could be improved with them.

So I think the best advice is - when you come across something you don’t know, don’t keep going - stop for a little while, look up some examples, run a few examples, and always learn. In the end, the question of building knowledge is simply a question of whether you want to deal with uncertainty and learn, or avoid uncertainty and hope to find someone else’s implementation that perfectly suits your needs.

2 Likes

Well, #3 approach works better with a dive into programming book once in a while, because some techniques cannot be figured out. However, I think that when “looking up something you don’t know how to do”, people will inevitably stumble upon better and more efficient techniques, or at least mentions of those techniques. And at that point breadcrumb trail will lead to more documentation and additional info. It is matter of having some curiosity.

1 Like

That is true.

In reality none of the techniques are really bad. Different people learn in different ways. Pick one that works for you and run with it. And if you can pick multiple different approaches, so much the better.

Very good IMO, I personally only found the ball roll and space invader tutorial useful, the rest I kinda dug around with the API and googling.

In terms of learning c# I can’t believe that would be that useful - unity is basically understanding the API, it could be c# or whatever language, heh. Sorry dotnet fanboys :wink:

So my advice would be hit up those video tutorials, be wary some of them are using deprecated code, that will be one of your biggest issues, but once you get the hang of things you can easily swap it out for the relevant code in the documentation for the version of unity you have downloaded.