How to learn Unity C# better and faster?

Hello,

I know that this question might have been asked before but I am really struggling with learning Unity and C#. I’ve been trying to learn and do stuff on my own for almost 2 months now.
I have watched a lot of YouTube tutorials, reading trough tutorials I know some of the basics but after doing all of that I will be like “Cool, I wanna do that by myself” but then I have the editor open all ready to do the stuff I want and I just stay there, not knowing how to start or to do the things I want to do.

I have an idea of a game I want to make, a small tycoon style game , a somewhat of a combination of Software Inc, Youtuber’s Life and Game Dev Tycoon. And yes, I know this might be a huge task for someone who is new programming, the only experience I have is with HTML and CSS.

So does anyone have any tips on how to learn properly I guess and at the same time a bit faster? I realize that I am not going to become a programmer over night but still I want to be able to make a game soon-ish.

Thank you in advance.

it’s called a language because though its not quite on the same difficulty, it is something like learning a whole nother language.

your best bet, therefore, is to either pick a tiny portion of your game, or a very simple separate game and focus on trying that.

obviously, you can follow along with tutorials, though you can suffer from a kind of, not totally understanding what your typing, what it does.

in Unity a decent chunk also comes from a solid understanding of the unity engines API. The built-in functions.

knowing how to find all nearby objects, how to look at things, how to move properly (slerp,lerp)

reading other code can help too, you need to read though and make sure you understand exactly what each line does and why it does that.

This is why again generally you want to pick just one aspect of your game and say i’ll just, i’ll create the code to move the camera and restrict it’s movement.

i’ll create the code to spawn sections of buildings. ideally try to do the more interesting stuff without per say going this will even be in your game, it likely won’t, once you get more complex you’ll need concepts like inhertience and the game loop and several other things to kind of keep everything managable and such.

But getting something a bit difficult to at least work will actually (at least for me) give you a sense of accomplishment when you finally solve the problem and that is what can motivate you to keep going.

lastlly you can try to help answer the questions of noobs even more noob than you, trying to teach it will often force you to really understand it.

I don’t think there’s going to be one giant resource that answers all your questions. Or that someone will have written a guide on how to build a Tycoon game with your particular needs. You don’t want that anyway, because you actually want to learn. You need to ask yourself, how do I get from here to my dream. I think you don’t actually know what you want to build enough yet because the clearer your vision of where you want to go then you know what bits and pieces you need to learn to get there.

Think of it a bit like playing basket ball. You want to get to the NBA but first you need to learn how to catch, dribble, pass and shoot. If you don’t learn those four things at even a basic level, you can’t really play. NBA players are only doing those things at just a higher level of detail and combination of those things. So with code, there really are a set few plays that you’re doing over and over just in different ways. When you do most tutorials it’s kind of like they’re just telling you “catch, dribble, pass, catch, shoot”, without helping you get why you catch then or how to dribble. Sure you can copy their code but it’s different to actually type it from your head.

I think you might need to start with a piece of paper. Draw what your game will look like. Even if it is just crappy boxes with words inside them for now. Figure out how many objects there will be. Then just focus on each object and what properties does it have? Eg. What colour, what size, what score, what image. Figure out what type of values you need to record that, are they numbers or just text or a bitmap? Then what does that object do? Like what action will that object take? Getting this stuff on a piece(s) of paper so you can see what you’re thinking in something a bit more structured. It’s also low time cost because you can draw and write whatever you like and if you don’t like it, just cross it out. This sketching step is really useful for mapping out where you want to go. It also creates energy towards what you’re wanting to achieve that you need to get past hours of debugging a problem later.

Now you have to build those inside the computer. Just pick one of those things, and for now the easiest one you think. Maybe it’s just a UI element. Then build that as an object and have it do the action you want. If you don’t know how to build just that object then search specific questions on how to build that part of the object. I’m not sure where you’re at but maybe you need to search what a For loop is, what Classes are, what is MVC, what is data typing, what are methods, and when you use these things. I find that there’s not a lot of great content out there explaining C# as much as there is explaining Javascript which the basic concepts can be achieved in C# using different syntax. Also you can get Javascript codepens where you can see things working in action in no time and play without having to care about stupid downloads and libraries.

But what you’ve got to do is just do enough smaller tutorials, like these tutorials are pretty decent at explaining the basics of Unity and C#,

I also found Stanford’s CS content great:

https://online.stanford.edu/course/computer-science-101-self-paced

These two courses were the most useful courses in my online code learning experience. They look dated but I still don’t know anyone online explaining this stuff at the pace and detail they go to.

The book, Headfirst Design Patterns is also really useful to explain code patterns that are useful in a range of different languages.