Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How to learn C# for Unity3D?

Discussion in 'General Discussion' started by Ziya, Jul 15, 2014.

  1. Ziya

    Ziya

    Joined:
    Aug 30, 2013
    Posts:
    65
    Once I got answer "You have to learn C# absolutely separately from what Unity Learn offers",
    and there are

    -WinForms
    -WPF
    -ASP.NET

    And what to learn to work with Unity3D?
     
  2. Developer007

    Developer007

    Joined:
    Jul 8, 2014
    Posts:
    31
    well, no of that you mentioned , know the console application and classes, variables, loops ,
    because am works with win-forms for 2 years, but when i came to unity i feel like i learn new language lol.
    so try your best to know that:


    1-Methods.
    2-Property.
    3-Classes and Structures.
    4-Enumerations.
    5-Interfaces.
    6-Datatypes.
    7-Delegates.
    8-Inheritance.
    9-Polymorphism ( Override,Overload ).
    10-then go unity documentation................. just that all i know.
     
    Ziya likes this.
  3. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    The person that gave you that answer must have been talking about something else. If you want to learn C# for use outside of Unity, then obviously you should learn things like the .NET platform.

    If you want to learn C# to use for Unity, then there is no better way than to start with the tutorials Unity offers here on the website and get comfortable with the scripting documentation.

    Of course that's not to say utilizing the .net library is not helpful, but it's not really a necessity to program for Unity.

    P.S If you are new to programming in general, any old beginners programming tutorial should get you started. Obviously one in C# would be ideal, but it can be any language really.
     
  4. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,738
    Yep. Learning your first programming language will take months if not years. Your second will probably take weeks. Your fifth programming language, you can probably learn in a day*. You start to see patterns in the way these things work.

    *Unless it's Objective-C, which makes no earthly sense to me >.>
     
    smitchell likes this.
  5. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    This advice may be good for hardcore coders, going to university. But you want to make a game with Unity, right?

    Usually you learn much better by doing. And doing means in our case here to grab Unity and simply start toying around. There are enough Unity tutorials around.
     
  6. Ziya

    Ziya

    Joined:
    Aug 30, 2013
    Posts:
    65
    guitarxe, So Unity Learn is completely enough to become a game maker and there is not any need to learn C# separately on it's website. Right?
    Please correct this opinion because it matters most to me.
     
  7. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Right.
     
  8. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    Not exactly what I meant, Ziya. Learning to use Unity and learning to program are two different things, but nobody says you can't do both at the same time. You can start off with just the basic tutorials for programming found on this website, but if you've never touched a programming language before it might be a tad too bare-bones for you with not enough information.

    To be honest, if I had to start with just those, I would probably have been left confused and not learned enough from them, and thus would go seeking additional tutorials elsewhere.

    But again, that's for learning programming in general, and you can do that with just about any modern language following any tutorials/books/whatever you want. Once you get the basic idea and concepts of programming, it is the same in any language. Then you can easily follow the tutorials on Unity to learn how to use C# and Unity's API. (you'll want a C# reference on hand for the syntax if you hadn't used C# before).
     
  9. zDemonhunter99

    zDemonhunter99

    Joined:
    Apr 23, 2014
    Posts:
    478
    Not really.. You'd need way more knowledge than just knowing what to do. You should know how to implement it. Buy a few books and watch tutorials. There are thousands of those Out there.
     
  10. Ziya

    Ziya

    Joined:
    Aug 30, 2013
    Posts:
    65
    >Right.
    > Not really..
    > To be honest, if I had to start with just those, I would probably have been left confused and not learned enough from them, and thus would go seeking additional tutorials elsewhere.

    Right or no?
     
    Last edited: Jul 15, 2014
  11. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    I meant to say that the tutorials on this site are not enough and aren't really designed to teach you programming, but rather how to use Unity, starting from the very basics. You may want to find additional learning resources on the web if you are a beginner programmer.
     
    Ziya likes this.
  12. Ziya

    Ziya

    Joined:
    Aug 30, 2013
    Posts:
    65

    Ok, I should learn C# programming separately.
     
  13. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    You don't need to do it separately from Unity. Like someone had already mentioned, there are many tutorials on the web that will teach you programming, using Unity with C#. Just search for them.
     
  14. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,738
    Utterly wrong. They have a tutorial on IF statements, FFS.
     
  15. calmcarrots

    calmcarrots

    Joined:
    Mar 7, 2014
    Posts:
    654
    Ugh no! Programming should be learnt separately. If you start with Unity scripting, you will start writing code because you don't know what it does, you just know your end result. How will you know what an int is? Or a float? Function? Sure you might learn on the way but it will be much harder. Learn C++ (its a nice starter Lang). Then go into DirectX programming. Then Unity. Trust me, you will benefit from that a lot more. Work your way up. I learnt c++ from this website a few years back:
    thenewboston.org

    Good luck
     
  16. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,714
    lol wut
     
    DiscussedTree and calmcarrots like this.
  17. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,738
    Much of the reason Unity exists is so that you don't have to learn low-level C++ and DirectX.

    Most people learn best by trying new things, experimenting, and exploring. Unity enables that in a big way. It compiles your script immediately and gives you visual feedback on what's going on. Even if you did wish to learn C++ and DirectX programming (which, unless you're making a game engine, feels like a huge waste of time to me), I would suggest the exact opposite approach as yours. Learn C# in Unity; then dig deeper from there.
     
    DiscussedTree likes this.
  18. Ziya

    Ziya

    Joined:
    Aug 30, 2013
    Posts:
    65
    People, I see there are controversial opinions.
    My question was about:
    Is Unity Learn completely enough to make any game possible for Unity.
    I mean If a novice is not aware of what is C# and programming at all, but he just wants to make pretty good games so there are two options:
    1. He reads all the Unity Learn and then he is a super game maker.
    or
    2. He learns C# separately and then does first item.

    I feel a novice should learn C# Programming Guide on msdn (classes, strings, arrays and etc...) and then do first item to be a complete professional on Unity.
     
  19. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    I agree with this. If you ask some old-time programmers how best to start learning programming, they will probably point you to some low-level language and tell you to learn that first, because that's how they did it, it worked for them, and so therefore they recommend that method. Nothing really wrong with that, but they probably never had the luxury of high-level languages at the time they were learning to program.

    It is easier to learn programming concepts by using a high level language that abstracts most of the nitty gritty details away from you. For example, what do you think is easier to grasp - C++ with SDL/DirectX/OpenGL or something like Flash where putting a picture up on screen is accomplished with a single line?
     
    DiscussedTree and StarManta like this.
  20. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    If you read my statements carefully, I am only saying that for some people, the information provided by Unity's tutorials may not be enough to learn programming from scratch.
     
  21. guitarxe

    guitarxe

    Joined:
    Dec 1, 2013
    Posts:
    131
    Yes, this thread has gotten pretty messy and I am starting to repeat myself so I'll just give my opinion one more time to make it more clear:

    To program in Unity you need to know how to program in the first place. You can learn to program however you want - whether the tutorials provided by Unity are enough for you or not entirely depends on you. Give them a try and if you find yourself lost, simply search for more tutorials on the web. If things still don't click into place, try some books. They usually have much more in-depth explanations. If you still can't understand even then, well take a break, go for a walk. Come back and try some other tutorials. Different ones. Maybe even a different language (try flash, it's easy!). Keep trying until eventually things just click.

    Oh lordy, stay away from the msdn. It is an invaluable reference for C#, of course, but it seems like it was written by an academic rather than a practical user of the language. It will of course be your reference for C#, but by no means should you try to use it as a beginners learning tool.
     
    DiscussedTree, Ziya and StarManta like this.
  22. Ziya

    Ziya

    Joined:
    Aug 30, 2013
    Posts:
    65
    I understand msdn pretty good and I am not talking only about Unity Tutorials, but also about all of the documentation provided by Unity on its website. And I think Unity Learn doesn't teach programming, it teaches how to make games, in other words it teaches programming only for making games.
     
  23. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,738
    It teaches programming with the intent being that you can make games. These are not two different things.
     
  24. calmcarrots

    calmcarrots

    Joined:
    Mar 7, 2014
    Posts:
    654
    You are right that it may be easier to learn Flash or Unity or whatever but honestly... was c++ ever hard? Also, if you get the "hard" language out of the way then everything will be much easier. Unity is great and if you would really like to pursue programming then learn c++ first. If you are more into the games, I guess you could go to Unity. But I still believe that a previous programming experience will further your comprehension of Unity systems. It will allow you to solve problems better and make better content.
     
  25. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,714
    Nah.
     
    DiscussedTree likes this.
  26. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,738
    I'm gonna preface this by saying to Ziya: We're well beyond the point of providing you any useful advice on to you this front. But if I know anything about the Internet, we're gonna be kicking sand around this sandbox for a while anyway. ;)


    The hardest parts of C++ are (conveniently enough) the most irrelevant parts of C++. Trying to figure out how this thing compiles. Where am I supposed to put the files for #include. It's been a while since I've used C++, but unless it's changed, the error messages C++ compilers usually give you are utterly worthless compared to the compile errors you get in modern languages. The whole syntax of the way C++ accesses object-oriented code reeks of a language that had OOP slapped in as an afterthought (which is, of course, accurate). And gosh, it's annoying that I have to have the function header in a .h file in addition to the function itself in my .cpp file.

    They literally created the C# language to fix all of the annoying, not-fundamental-to-programming problems that C++ has. Why would you use a telegraph when you have a cell phone?
     
    DiscussedTree and Ziya like this.
  27. Ziya

    Ziya

    Joined:
    Aug 30, 2013
    Posts:
    65
    I am a beginner, but that is exactly what excited me about C# and became my motivation to learn C#.

    C# Programming Guide is not Winform, Webforms or Library , it is foundation for all .Net framework and I guess it is what I will exactly need for to program games on Unity.
    Developer007 also mentioned that.
     
    DiscussedTree likes this.
  28. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    And i still disagree. You can start in Unity, you can stay in Unity, and learn everything needed in Unity. You don't need to leave Unity for a single moment when you want to make a Unity game.

    It's the other way around as statet here before. You can learn the basics in Unity, and start exploring from there then.
     
  29. Kaji-Atsushi

    Kaji-Atsushi

    Joined:
    Oct 6, 2012
    Posts:
    234
    I say just dive into the Unity Learn tutorials and start from the basics on there. If you feel confused about the whole infrastructure, then you can learn about C# separately and the Unity learn tutorials. But generally learning C# at first in my opinion, would be more confusing then learning it directly with Unity's workflow.

    Good luck.
     
  30. Ziya

    Ziya

    Joined:
    Aug 30, 2013
    Posts:
    65
    That feels good to me.
     
  31. TRALLALAL

    TRALLALAL

    Joined:
    Sep 7, 2013
    Posts:
    132
    I wouldn't say C++ is a good starter language...
    Also, DirectX is not an engine so what does it have to do with Unity? I know nothing about DirectX yet I'm doing it good in Unity.
     
    DiscussedTree likes this.
  32. Ziya

    Ziya

    Joined:
    Aug 30, 2013
    Posts:
    65
    To be a game maker is to know all the Unity Learn (Manual, Tutorials, Scripting).
    To be a programmer (example: C#) is to know all the C# Programming Guide on msdn.

    Then to start practicing.
     
  33. TRALLALAL

    TRALLALAL

    Joined:
    Sep 7, 2013
    Posts:
    132
    I know that, I know C++ and C# and at the moment I'm working on my second game but saying you have to learn DirectX to properly code in Unity doesn't make sense as if you'll ever use DirectX you will use it to make your own engine.
     
  34. christinanorwood

    christinanorwood

    Joined:
    Aug 9, 2013
    Posts:
    402
    I personally believe it is easier to learn C# outside of Unity. But there's a lot of C# that is not relevant to Unity. I have a playlist of tutorials on YouTube designed to teach prospective Unity developers some useful basics before moving on to the Unity tutorials provided by Unity or others. About 5 hours total. A few people have commented that my explanations are clear and simple. Probably because I've been teaching for 25 years (not all programming though).
     
  35. calmcarrots

    calmcarrots

    Joined:
    Mar 7, 2014
    Posts:
    654
    I never said that needing Directx experience before Unity is required. I am suggesting that to you. Also, it's not an engine in the way you think about it. It's a graphics API in which you create the engine itself. I told you to learn Directx first because you would understand the science of graphics in your game, and it might enable you program even more efficient games. And that is one of the hardest things about programming in general, efficiency. Also, it is very fun to make games from scratch, from nothing but code. If you don't want to, then don't but your chances of being better at game programming originate from prior experience. Good luck :)
     
  36. TRALLALAL

    TRALLALAL

    Joined:
    Sep 7, 2013
    Posts:
    132
    Just to point it out, I'm not the OP and in the message you quoted I said if he's going to ever use it he will use it to make his own engine.
     
  37. calmcarrots

    calmcarrots

    Joined:
    Mar 7, 2014
    Posts:
    654
    No not like an engine like unity. An engine as in a code base that handles the logic of your game. For example, if your game needs physics, you must program physics. Thus, you then have a physics engine.