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. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Getting Started with Coding for Unity

Discussion in 'Community Learning & Teaching' started by Adam-Buckner, Dec 1, 2011.

  1. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    This is a sticky for links to resources that will help new users to get started coding with Unity.

    [Please NOTE! This thread is not intended as a support or scripting thread for help with specific coding issues. Please use the Support or Scripting sections for that.]

    The first place to go, is the scripting topic in the Learn section of the Unity site:

    http://unity3d.com/learn/tutorials/modules/beginner/scripting

    Then, if you want more, here are some additional resources for learning C#:
    C-Sharp Station: Tutorials
    LearnCS.org - Interactive C# Tutorials
    C# Fundamentals: Development for Absolute Beginners
    C# for Beginners – Microsoft Virtual Academy
    C# Yellow Book
    Catlike Coding C# Tutorials

    ARCHIVED LINKS BELOW (I have not vetted these, and they could be stale):

    Archived resources for learning CS:
    Visual C-Sharp Tutorials: Introduction to programming
    C Sharp Fundamentals Development for Absolute Beginners
    Catlikecoding: Unity Tutorials
    Unify Wiki: C-Sharp Tutorial

    Here are some resources for learning UnityScript (Unity's "JavaScript"):

    Unify Wiki: Programming
    Unify Wiki: Head First into Unity with UnityScript
    Newbie guide to Unity Javascript (long)

    (UnityScript.com: What was a very good site for the absolute beginner learning UnityScript, but now only available thru the Internet Archives... Sadly many images and the pdf is missing.)

    Here are some resources for learning language-independent concepts:
    Which kind of array or collection should I use?

    - This is not a thread to discuss the differences or advantages of one language over another. -
     
  2. Nomad72

    Nomad72

    Joined:
    Oct 25, 2011
    Posts:
    117
    The language-indepenent concepts list is one I'm going to be keeping a close eye on - that first link is really useful!
     
  3. Diviner

    Diviner

    Joined:
    May 8, 2010
    Posts:
    677
    You might want to add this to the links above :

    http://www.aihorizon.com/index.htm

    It deals in AI development, something that every game dev will bump into at one point or another. And to avoid misconceptions, I am talking about AI, not Finite State Machine modules (like attacking, idling, fleeing, etc). People seem to confuse the two. This page deals in making the AI take strategic decisions and reach an outcome (like minmax Chess AI).
     
  4. Rush-Rage-Games

    Rush-Rage-Games

    Joined:
    Sep 9, 2010
    Posts:
    1,997
    Good idea!
     
  5. Games Unity

    Games Unity

    Joined:
    Apr 15, 2012
    Posts:
    27
    Thanks, Excellent tutorials!
     
  6. BassO

    BassO

    Joined:
    May 8, 2012
    Posts:
    2
    Actually, there are so many resources (books, online tutorials, video courses, interactive tutoring) that I'm lost as to what the fastest way to absorb this (programming) knowledge is. If money is no issue, what's the best/fastest way to get into Unity Scripting?
     
  7. Meta

    Meta

    Joined:
    Apr 29, 2012
    Posts:
    1
    I have the same concern right now. Since all of these resources tend to overlap in terms of what they actually teach, I choose to devote the time to one course or book at a time until I really absorb everything. Then I'll begin another book. It's a little disheartening at times, like I just finished a joes to pros book on c#. But c# used in unity seems to use slightly different terms and logic. But it's still very familiar in terms of syntax. So I definitely don't regret reading that book, because now the main thing for me to get familiar with is the scripting reference for unity.
     
  8. mohammadmahdi

    mohammadmahdi

    Joined:
    May 24, 2012
    Posts:
    7
    Thanks, Excellent tutorials!
     
  9. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    BassO, Meta: There are two basic approaches - Applied and Theoretical. If you want an applied approach, I'd suggest running through as many Unity and 3rd Party tutorials and observe how the language is used. If you want the theoretical approach, I'd suggest books and tutorials about Object Oriented scripting and languages, language pattern and (probably easiest) a focus on C#.

    TBH: I'd do some combination of both.
     
  10. stimarco

    stimarco

    Joined:
    Oct 17, 2007
    Posts:
    721
    Hi Little Angel,

    Do you mind if I point at my own C# Unity tutorial? It's on the Asset Store (links in my signature below). It's not free, but it is a pretty complete turn-based Tic-Tac-Toe game, which may be of interest to those more interested in turn-based games in Unity in general.

    I believe a good tutorial should explain "what", "how" and "why", so I included a thorough 40-page PDF explaining what it does, how it works and why I wrote it the way I did.
     
  11. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  12. Diviner

    Diviner

    Joined:
    May 8, 2010
    Posts:
    677
  13. FoxMccloud64

    FoxMccloud64

    Joined:
    Jan 18, 2013
    Posts:
    1
    This may be useful for my next game project :)
     
  14. Viking1972

    Viking1972

    Joined:
    Jul 24, 2009
    Posts:
    74
  15. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I'll try to get a look at these, but in any case they'll be here if not up on the first post!
     
  16. gingir

    gingir

    Joined:
    May 21, 2013
    Posts:
    3
    Man these video tutorials are awesome.
    C has always been my weak spot ... long and tedious books have never helped me out.
    I have a feeling video tutorials are the way for me to succeed.
    Bookmarked.
     
  17. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    I'd like to request my signature link gets posted here. Thank you!
     
  18. AeonixG

    AeonixG

    Joined:
    Jan 23, 2013
    Posts:
    1
    Thanks for the heads up!
     
  19. ColdTree

    ColdTree

    Joined:
    Jul 9, 2013
    Posts:
    2
    Thank You So Much For This Share! First Link VERY useful! I Had NO idea About The Code Used In Unity,
     
  20. snakedungeon

    snakedungeon

    Joined:
    Jul 21, 2013
    Posts:
    1
    can someone tell me how to make a character move using arrow keys because i am a beginner:confused:
     
  21. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    A few things...

    First, if you have a question, you should post it in one of the support sections. Tho' I appreciate you are trying to learn scripting and have found the teaching/scripting area, a good place to ask a simple question is in the appropriate section.

    Second, look in my .sig for a link to a Custom Search Engine. Use this to search for what you are looking for, as many of the most simple subjects have already been answered.

    Third, have you looked at the "Learn" section of the website or taken any of the live classes? If not, you can look here to get started:
    http://unity3d.com/learn

    In the learn section you will find pages on Tutorials:
    http://unity3d.com/learn/tutorials/modules

    ... Live Classes:
    http://unity3d.com/learn/live-training/

    ... and the Documentation:
    http://unity3d.com/learn/documentation
     
  22. EverReddie

    EverReddie

    Joined:
    Apr 6, 2014
    Posts:
    2
  23. LeonardWatts

    LeonardWatts

    Joined:
    May 13, 2014
    Posts:
    13
    Wow thank you, just what the Dr. ordered!
     
  24. shahan

    shahan

    Joined:
    Jan 27, 2014
    Posts:
    25
    Thank you this is awesome, I'm a newb and this helps a lot, thank you.
     
  25. RDFMAN111

    RDFMAN111

    Joined:
    Feb 19, 2013
    Posts:
    1
    Hello,
    I'm trying to learn scripting for unity 3d and have no scripting or coding backround.
    I've been using a book and would like to know if this script would work, as I remembered the script with a few differences and I'd appreciate if this script would work. I under stand variables with the integers and floats, and strings and boo leans but I don't know functions very well and am starting to learn that more.
    Here is the script:

    {Function doorBells (anyVariable = true)
    }
    Debug.Log(anyVariable);

    {function Start()
    }


    Var location : String
    Var noClue : String

    location("I'm down here to your left")
    noClue("I don't know, I'm lost")

    {function Update()
    }

    Any help would be appreciated, thanks!
    Sincerely,

    RDFMAN111
     
  26. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    You should repost this in the "Support" section.
     
  27. Jasper1900

    Jasper1900

    Joined:
    Mar 15, 2013
    Posts:
    26
    Maybe you guys can make a tutorial about GUI movable functions using Mathf functions and such. Or do you have some already?
     
  28. Nicholas-Ostheimer

    Nicholas-Ostheimer

    Joined:
    Jun 28, 2014
    Posts:
    15
    ''You should repost this in the "Support" section.''

    @Adam

    Does that go for any questions in response to posts by forum moderators?

    Nicholas

     
  29. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Nicholas? I'm not sure I understand what you are trying to say?

    "Getting started with coding" is a thread about how to find coding resources.

    The "Support" and "Scripting" topics are for people who have specific questions about how to use Unity or how to get a specific piece of code working.

    If you are referring to RDFMAN111's post, that post should either be in the support or scripting sections, as they are asking about a specific script, and why it doesn't work.

    As of the time of this post RDFMAN111 has not posted any further:


    They have only one post.

    I have also PM's RDFMAN111 with resources to "Get Started" with Unity, but so far I have received no response.

    Or did I misunderstand your comment?
     
  30. Nicholas-Ostheimer

    Nicholas-Ostheimer

    Joined:
    Jun 28, 2014
    Posts:
    15
    Thank you Adam, that clarifies it for me.
     
  31. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    What is a "GUI movable function"?

    Mathf is a very useful set of Math Functions:
    http://docs.unity3d.com/ScriptReference/Mathf.html

    I'm unclear what this has to do specifically with a UI...

    Can you help me understand?
     
  32. christinanorwood

    christinanorwood

    Joined:
    Aug 9, 2013
    Posts:
    402
    I have a YouTube playlist on learning C#. It's not programming in Unity, just basic concepts, but I made it with new Unity developers in mind and have used MonoDevelop or Xamarin Studio. Some people are finding it useful so it might be worth adding to your list of resources.
     
  33. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Thanks for the post Christian. I look forward to looking through these.
     
  34. Magiichan

    Magiichan

    Joined:
    Jan 5, 2014
    Posts:
    395
    Alot of these links seem to be broken Adam. :/
     
  35. hnasef

    hnasef

    Joined:
    Aug 6, 2014
    Posts:
    1
    thanks for this thread, I think am a little bit late, but the links for "UnityScript" you posted is not existing anymore .. can you please post new links for UnityScript Tutorials for beginners (and by beginners i mean who have no idea whats a code)?? as am really lost here :) thanks
     
  36. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Yeah, I noticed that. Magiichan got me looking.

    The post is a little bit stale, and I'm sad to see the UnityScript links go, as they were a great explanation of coding/programming in human terms.

    You may want to check the "Way back machine" on the Internet Archives.

    I'm buried getting ready for Unite 14 in Seattle, so I won't be able to update this thread until September.

    nasef, I'll be doing a live training session in Sept. about coding for the completely uninitiated... so watch the Live Training list in the Learn section of the website.

    Just to warn you, this will be C#, but I think I can get you coding in C# from nothing ...

    Also, try the Roll-a-ball project in the Learn section as a way to get started.
     
    Magiichan likes this.
  37. OboShape

    OboShape

    Joined:
    Feb 17, 2014
    Posts:
    836
    For those who like working through video tutorials.
    There is a free 25 session beginners C# course using the free visual studio express edition.
    i know its using VS, as the course is supplied by Microsoft..

    Im working through this just now to see what like it is, thought i would share.

    this is from Microsoft Virtual Academy (Main Site)

    C# Fundamentals for Absolute Beginners (Course Link)


    There are some Unity Specific modules on there on how it pertains to the windows store etc.
    worth a dig around
     
  38. Magiichan

    Magiichan

    Joined:
    Jan 5, 2014
    Posts:
    395
    Oh god, unifycommunity.com is gone Õ n Õ
     
  39. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,346
    wiki.unity3d.com

    --Eric
     
    Magiichan likes this.
  40. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Thanks, Eric!

    I didn't realize we still had an old link in the header.
     
  41. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    I am artist,I know visual script like playmaker,uscript,icanscript.

    Now I want to learn c#,can u suggest which learning path I should follow?
     
  42. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I would suggest following the starting projects in the Learn section: roll-a-ball & space shooter. This will be a good introduction to coding in the context of a project. You can also check the scripting section of the Learn site. There are some good lessons there. On the original post, there are some links to non-Unity coding sites, so you can study C# independent of the context of Unity.
     
  43. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Thanks for your suggestions.
     
  44. Rick Love

    Rick Love

    Joined:
    Oct 23, 2014
    Posts:
    76
    I'd like to offer Codey's Lab as a suggestion:

    (I am the developer and have spent 5 months full-time developing it.)

    Codey's Lab is an interactive tutorial that runs in Unity.

    Here is a free trial if you want to test how it works:
    https://www.assetstore.unity3d.com/en/#!/content/38910

    According to the reviews, it has helped people who could never get started using books and videos alone:



    Although, Codey's Lab is not free. It is cheaper, contains as much content as any $60 book, and forces you to actually learn. As you code, the game is running and you see a live preview of how each line of code affects the game instantly. You can jump to any step in the tutorial and the game immediately changes to use the code at that point in the tutorial. You can even experiment with the code and switch out values in the code and see what happens live.


    This sounds too good to be true, what's the catch?


    - It's not free (but it is a great value and you can try chapter 1 of each course for free)
    - It takes a long time to author courses (you might have to wait for a specific course to be finished, but I'm working on some authoring tools to speed this up)
    - It's new (This is for people who aren't satisfied with books and videos and think game developers should have interactive training simulations kind of like the games we want to make)
     
    the_motionblur likes this.
  45. Bugti_8888

    Bugti_8888

    Joined:
    Oct 13, 2015
    Posts:
    1
    Hello Adam, I watched one of your tutorial today when I was just so frustrated that I was thinking of giving it all up... But after watching one hour video .. not only am I ready to write script but continue with the work...
    I would like it if you make more tutorials for absolute beginners. A match 3 game tutorial which would explain everything we need to know about making such game and what's the secret that sometimes in Candy Crush game the levels become so easier and other times so difficult... What's that algorithm... I hope my comment will not go unnoticed... and you will soon come up with a tutorial that explains how to make a game like candy crush for android platform...
    P.S. excuse my poor English.
     
  46. Mrinaank

    Mrinaank

    Joined:
    Jul 25, 2015
    Posts:
    14
    Hello Adam, I'm still new to unity, having started only 3 months ago, and have visited many of the above links. I was wondering if there was any tutorials on Unity Multiplayer, Chat systems and how to code the UI for the lobby scene for a multiplayer game.

    Thx in advance!!!
     
  47. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
  48. Mrinaank

    Mrinaank

    Joined:
    Jul 25, 2015
    Posts:
    14
  49. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Well, expanding it is a great idea. I'd suggest jumping in and giving the project a good whacking. If you have trouble, post in the multiplayer section of the forums. If you want to, you can tag me on the post and I'll try to follow along.

    We have more tutorial projects incoming.
     
  50. David K

    David K

    Joined:
    Nov 29, 2015
    Posts:
    1
    Thanks, just having checked out the first two these are super informative YouTube videos but are there any links just as detailed to text instead? I like most read about 3 times as fast as can listen to words spoken and plus in text it is easier to go back for better comprehension instead of having to pause and/or rewind videos. Not meaning to be picky, just I prefer text over video. Thanks!
     
unityunity