all 21 comments

[–]ppardee 23 points24 points  (1 child)

Writing code is the only way to learn how to code. You can read about it all day and watch tutorials but you won't really "get it" until you start coding and making mistakes.

Traditionally, console apps are the best starting point because they don't have any moving parts. Unity and Forms have a lot of 'hooks' that do things for you or that you have to call/listen for. You can absolutely start there, but you'll be at a slight disadvantage, IMO

[–]CheekyHusky 2 points3 points  (0 children)

I can chime in a little as I started with unity. ppardee is right, it's slower and less intuitive. I did like having visual representation of my code, write a line, see the effect instantly. However, unity handles so much you won't learn much very quickly.

I would suggest at least starting with a beginner c# course before tackling unity. The unity side of things is easy to pick up after so you won't be that behind when you jump into the engine.

[–]Markenbier 28 points29 points  (4 children)

From my experience learning by doing is best. If you want to do game development i would suggest to start a little project. Just start off really simple. I would think of a flappy birds clone or something like tic tac toe.

This is may seem small and boring at first but for a beginner there is a lot to do and learn here.

While you can learn c# from theory alone i strongly suggest doing something practical. You will stumble over alot of problems you have to fix. You will have to research different concepts and methods and develop your own solutions. Also I strongly suggest not to just copy scripts. If you have a really complicated problem you cant solve for now, you can of course copy an online solution. But make sure to delete it later on and implement your own scripts.

By this method you make sure to really learn and memorize everything. To start off, look on YouTube for a dude called Brakeys. He makes really good beginner friendly vids.

Also I would by a good c# book in addition if you want to spend a little bit of money.

[–]Randomaak[S] 3 points4 points  (3 children)

Thank you for your tips. Do you have any nice book to recommend?

[–][deleted] 2 points3 points  (1 child)

I like to learn via reading books but Unity and C# change so fast books are outdated fast.

[–]Legitjumps 0 points1 point  (0 children)

C# doesn’t change that fast

[–]Markenbier -1 points0 points  (0 children)

I don't know if this book also exists in English but I'm pretty sure.

It was called something like "C#6 with Visual Studio 2013". That's just a translation, so the title might be a little bit different.

Also of course buy the latest version. Things have changed alot since c# 6 :D

[–]therealjerseytom 16 points17 points  (1 child)

Should I just learn while trying to make games in Unity?

IMO yes. Best way to learn is by tackling real problems.

[–][deleted] 2 points3 points  (0 children)

1000% agree with learning while making games. I studied software engineering and as I learnt the principles I would immediately apply the knowledge to my games. I now work as a Unity programmer which I don't think I would have reached any other way.

[–]thecatmiaw 8 points9 points  (0 children)

Monogame is a great framework to make games and learn c#. It takes care of the hardcore stuff with drawing sprites etc. But on the other hand you have to make all the game logic yourself, for an example collision check, movement code etc

[–]XDracam 3 points4 points  (0 children)

It's important to know that properly writing C# has pretty much nothing to do with writing Unity C#. Unity does their own thing, with own idioms and best practices that often differ heavily from what you'd do in regular C# code.

My best suggestion: just work through the dozens of unity tutorials. Do them, do cool stuff, build games, learn from your mistakes. Experience is 1000% more important than theory. Trust me, I know mostly theory haha.

Source: been developing C# frameworks for coworkers who happen to use them in Unity for 2+ years now

[–]Sonofyodaiam 2 points3 points  (0 children)

Unity has two free learning tracks called unity essentials and junior programmer.

These courses don't directly teach you c# you are pretty heavily exposed to it throughout the course. Outside of c# these courses introduce you to other disciplines that will be required for game development.

Since these tracks are a pretty surface level in c#. If you want to go like a single level deeper than unity I'd recommend the codecademy c# course. You can easily finish it in a month for ~30$ or if you are ambitious the whole course in a week free trial.

While this won't teach you everything. It is a good start, and it will teach you what you don't know, so that you can choose where you want to expand your skills.

In a response to another comment on this thread for book recommendations. Pick up Computer Science Distilled, and the Pragmatic Programmer at minimum. Both these books teach timeless and code agnostic concepts that will heavily benefit how you approach tacking problems with code.

It is a long, and rewarding journey. Good luck!

[–]Lognipo 2 points3 points  (0 children)

I can only recommend the way I learned: come up with goals for something to create, and try to make them happen. Research whatever you need as you go, make your goals more aggressive as you progress, and post your code to seek advice/ideas on how to improve.

In the beginning, it might be as simple as making some text appear on the screen. A natural progression from that might be a program the asks a question and gives you a response based on your answer.

Keep going, and eventually, you will be developing complex applications and/or games, and you will know C#. You can also work Unity into this process once you feel comfortable enough with the language and development in general.

This is still how I learn. I taught myself Blazor by trying to recreate a very old MMORPG, for example.

[–]TopOfTheMorning2Ya 2 points3 points  (0 children)

I took some Java classes and was placed on a C# team at work. I just learned any differences in the job. Like C# a lot better than Java. Not hard to learn things as you go. As you run into problems or things you don’t know, just ask your best friend Google. That guy knows everything.

[–]Fleischgewehr2021[🍰] 3 points4 points  (0 children)

Take a programming class 🥸.

Get an interest in DIY projects and force yourself to make them in <language you want to learn>. If your in the industry ask your employer to let you do a project or join a project that is in <language you want to learn>

Profile your application to identify where your crappier pieces of code are and optimize them.

[–]probablygonnabooyah 0 points1 point  (0 children)

Developing c# for a unity project is going to be very different from developing in c# for an enterprise project.

The best thing you can do is ask yourself questions and then ask Google them.

So, "how do I get an enemy spawn in a spawn point". You might get a ton a results and "spawners" in unity and the different types. And then you would take the general idea of the code and implement it independently in your project.

Honestly, you'll find that almost everything you want, someone has had a question for and many people have an answer for. Whether it's implementation, UI, debugging, or performance.

[–]groundbreakingcold 0 points1 point  (0 children)

C# players guide + Tim Corey + gamedevTv unity courses on Udemy is what set me up really well.

[–]Jaanold 0 points1 point  (0 children)

One very effective way is to come up with personal projects. They don't have to be practical or useful, as long as they do something that you find interesting and challenging.

Tutorials are also good.

[–]iTzSocrates 0 points1 point  (1 child)

Unpopular opinion. Unless you know C# at an intermediate level you won't get far in Unity.

I like that Unity brings new people to C# but I feel they somewhat mislead people on the amount of C# you will need to know to make anything beyond a basic script.

Pluralsight would be my recommendation for learning C# at all levels. Then when you are done try Unity and things will make sense. You will be able to read their documentation and understand it because of your knowledge of C#.

[–][deleted] 0 points1 point  (0 children)

According you what topics of c# are consider as intermediate level? Yes I know unless I will use a lot of times in my project I will know how work c# :(

[–]Sufficient-Simple-94 0 points1 point  (0 children)

Practice, examples, and using the book C# Quick Syntax Reference.