Search Unity

Finally, an interactive tutorial series that WILL teach you C# for Unity3D

Discussion in 'Community Learning & Teaching' started by SubZeroGaming, Mar 25, 2013.

?

Would you like to see more c# Interactive tutorials?

  1. Yes

    1,404 vote(s)
    98.9%
  2. No

    15 vote(s)
    1.1%
  1. massey_digital

    massey_digital

    Joined:
    Apr 28, 2013
    Posts:
    94
    I was actually just needing to come up with a way to pause my game before I release it. I'll make sure to check out your video!
    Thanks SubZero!
     
  2. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Thanks, Drew! :)
     
  3. Veity

    Veity

    Joined:
    Aug 9, 2013
    Posts:
    3
    Thanks for the explination SubZeroGaming, i sucessfully completed the tutorial thanks to your help :)

    I decided to expand on what you taught us and try by myself to finish of the game. I succeeded as now there are five enemies, who can shoot back at the player.

    Here's a link to a video i posted showing the completed project: http://www.youtube.com/watch?v=0viNK84X7lk&feature=youtu.be


    My code is really bad for this project (but i learned alot from it so :D...) as there are five separate enemies (not prefabs) and each one has their own unique 'enemy' script.

    I wrote the collision so that:

    - by default the variable to check whether an enemy is not/dead is set to no aka 'destroyed = 0;'
    - if player hits enemy, then enemy = dead for a random amount of time 'destroyed = 1;'
    - If (destroyed = 1;) enemy is dead, hide rendering, prevent enemy from firing lazers.
    - if ('enemy.destroyed = 1;) dead enemy hits player, no collision will happen.
    - when enemy respawns, 'destroyed = 0;' and enemy will respawn at random start location.

    The reason why my code is so bad is that each enemy uses their own enemy script, i.e. when player checks to see if an enemy hits them the statement looks like this:

    Code (csharp):
    1. if(collider.CompareTag("enemySpaceship")  (enemy.destroyed == 0 || enemy2.destroyed2 == 0 || enemy3.destroyed3 == 0 || enemy4.destroyed4 == 0 || enemy5.destroyed5 == 0) || collider.CompareTag("enemyLazer") || collider.CompareTag("asteroid"))
    I know this goes beyond the scope of this tutorial, but i was wondering if someday you would continue the spaceshooter tutorial and show us the best/most efficient way of allowing enemies to fire, and check for collision etc.

    As I said I learned a lot from this tutorial, but i know my method is bad programming, and im interested to see how it should be done :D
     
  4. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Hi Veity,

    Excellent job finishing up the space shooter and expanding. As far as continuing with the space shooter, I don't know if I'll continue that specific series, but I will certainly do a series on enemy AI so we can look at efficient ways to set up our enemies for combat.

    Thanks for watching!

    Best,

    SubZeroGaming
     
  5. Focuzed

    Focuzed

    Joined:
    Jul 21, 2013
    Posts:
    16
    Honestly, I quit after 3 min of the first tutorial. These are supposed to be interactive tutorials helping teach C# but in turn you start out saying, "If your like me, you can read code, this is a runtime, this is monobehavior, you know this calls this so this means that" Well I'm not like you, I don't know what any of it is from the very first letter. I thought this was teaching C# not assuming we already know it. But they may be helpful for some people but as soon as you started going through that I turned it off. But I will ty for taking your time to make these and further helping the community. I just wish I could find something to help myself that has literally 0 experience with coding and such. Just doesn't seem to be anything out there, and the very very few that look like they could help, are between 2-4 years old. Almost ready to just give up on the damn thing.
     
  6. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Sorry to hear that, I have listed a link in my signature to the fundamentals of programming.

    Best,

    Jon
     
  7. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
  8. airop

    airop

    Joined:
    Sep 4, 2012
    Posts:
    34
    private Transform myTransform;
    public int minSpeed = 1;
    public int maxSpeed = 50;
    public float currentSpeed;
    int xdir,ydir,zdir;


    // Use this for initialization
    void Start () {

    myTransform = transform;
    ydir=24;
    zdir=7;
    xdir = Random.Range(-50,50);

    myTransform.position = new Vector3 (xdir,ydir,zdir);
    currentSpeed = Random.Range(minSpeed,maxSpeed);


    }

    // Update is called once per frame
    void Update () {
    xdir = Random.Range(-50,50);

    myTransform.Translate(Vector3.down *currentSpeed *Time.deltaTime);

    if(myTransform.position.y <-10) {

    myTransform.position = new Vector3(xdir,ydir,zdir);
    currentSpeed = Random.Range ( minSpeed,maxSpeed);


    }
    }

    void OntriggerEnter(Collider other)
    {
    if(other.CompareTag("Lazer"))
    {
    Destroy(this.gameObject);
    }
    }
    }


    i tried everything with the code, but it just wont work. i got my tags right and there are no error messages, but my object does not get destroid.
     
  9. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    The method is: OnTriggerEnter

    you have OntriggerEnter
     
  10. Mossy101

    Mossy101

    Joined:
    Aug 25, 2013
    Posts:
    1
    Really good stuff here, thank you.
     
  11. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Thanks, appreciate it :)

    EnemySpawn video is being uploaded right now :)
     
  12. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
  13. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
  14. D_R-aldi

    D_R-aldi

    Joined:
    Jul 18, 2013
    Posts:
    1
    thank you very much for the tutorial :D
    they really are helpful
     
  15. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Hi D-R-aldi,

    I'm glad you enjoy them. Thanks for watching!

    UPDATE!

    New Unity3D C# Online University Coming Soon!

    Get ready for Digital Gaming Institute! Featuring curriculum based on a University style of learning! Full Curriculum, 35 hours + of content per course, lessons, course material, quizzes (to make sure you fully comprehend what you're doing), and so much more!

    Thanks everyone for watching and making this all possible!

    Best,

    Jon
     
  16. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    Could you please provide a link ?
     
  17. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Hi,

    the website is currently in development. You may follow the twitter account if you'd like. When the site is complete, i'll be updating this thread. And making a new thread possibly.

    Thank you.

    Twitter: @DGIStudents
     
  18. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Giving a bump to show the new LOGO for Digital Gaming Institute!

    $Screen Shot 2013-09-17 at 12.07.31 PM.png

    Receiving a few more revisions, but this is the base look so far!

    Feel free to follow development on Twitter @DGIStudents

    New beginning concept game projects coming out soon on YOUTUBE! Including, Pong, Breakout, And other popular starter games!

    Again, thanks everyone for watching and continuing to vote positively on this thread.

    Best,

    Jon
     
  19. Vovka

    Vovka

    Joined:
    Aug 6, 2013
    Posts:
    1
    that logo is baws, you should probably stick it on your site already. :cool:
     
  20. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    The website is in development. I'll be adding a subscribe page soon! Thanks for supporting!

    *NOTE*

    I'm offering c# programming lessons 1 on 1! Message me or add my Skype (same as my name). All proceeds are going towards the development of DGI.

    Best,

    Jon.
     
  21. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Updating the thread! Be sure to follow development for DGI on Twitter @DGIStudents
     
  22. The-Tumbleweed

    The-Tumbleweed

    Joined:
    Aug 6, 2012
    Posts:
    2
    Hi! I've loved your tutorials so far. They've really helped me out.

    When can we expect your third-person shooter tutorial? You mentioned it in the last tutorial, and I can't wait to see it. :)
     
  23. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Hi Tumbleweed,

    Thanks for watching! The 3rd person shooter tutorial is going to be a featured course when DGI is released. It's a 40 hour course packed with content! I'll be uploading some more public youtube videos in the coming week. I have a line of new tutorials coming up just for YouTube!

    Best,

    Jon
     
  24. The-Tumbleweed

    The-Tumbleweed

    Joined:
    Aug 6, 2012
    Posts:
    2
    Awesome! Thanks, Jon. I can't wait.
     
  25. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Thought I would share this:

    A user commented on one of my videos. This gives you a visual of how strong interactive learning is.

    $bLO1Upo.png
    No code to follow, and he produced the outcome on his own!

    Well done, viewer.
     
  26. ashley

    ashley

    Joined:
    Nov 5, 2011
    Posts:
    84
    Hey Jon,

    I've messaged you a few times through YouTube (until recently I've had problems getting on this forum) and just wanted to say thanks for all your help! Glad to see everything is progressing nicely with the site, really looking forward to it!
     
  27. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Hi Ashley,

    Thanks a lot! :) Also, I noticed you followed on Twitter. Thanks for that as well. Welcome to the Unity forums.
     
  28. mawak93

    mawak93

    Joined:
    Oct 28, 2013
    Posts:
    4
    Hey man love ur work (Y) ...but im having a prob

    i finished space shooter and everything works fine

    now i want to respawn the enemy after it dies ...so im using the following code


    public class Enemy : MonoBehaviour {

    Transform myTransform;
    public float minSpeed = 5.0f;
    public int score =0;
    public float maxSpeed = 10.0f;
    int x,y,z;
    public GameObject EnemyFab;
    public float currentSpeed;
    bool dead;


    // Use this for initialization
    void Start () {
    y=14;
    z=-1;
    dead=false;
    x=Random.Range (-14,14);
    myTransform=transform;
    myTransform.position = new Vector3(x,y,z);
    currentSpeed = Random.Range (minSpeed,maxSpeed);

    }

    // Update is called once per frame
    void Update () {


    x=Random.Range (-10,10);

    myTransform.Translate (-Vector3.up*currentSpeed*Time.deltaTime);

    if (myTransform.position.y < - 10) {

    myTransform.position=new Vector3(x,y,z);
    currentSpeed = Random.Range (minSpeed,maxSpeed);




    }


    }

    void Respawn()
    {
    y=14;
    z=-1;
    x=Random.Range (-14,14);
    myTransform.position = new Vector3(x,y,z);
    myTransform=transform;
    currentSpeed = Random.Range (minSpeed,maxSpeed);
    Update();
    Instantiate (myTransform,myTransform.position,Quaternion.identity);


    }

    void OnTriggerEnter(Collider collider)
    {
    if (collider.gameObject.CompareTag ("Lazer")){

    //if the lase hits the enemy....enemy will be destroyed
    Destroy (this.gameObject);

    dead=true;

    if(dead == true)
    {
    Respawn();
    }



    }

    if(collider.gameObject.CompareTag ("Player"))
    {
    Destroy (this.gameObject);

    }



    }

    }


    when the enemy dies it respawns as a clone alright....but is no where to be seen or to come down....i randomly attack and it hits the clone at some point and doesnt respawn....the thing is that it doesnt come falling down.....how do i make this happen?....plz plz plz help me out here bro.....really need it....Thank u very much and keep it up! :D
     
  29. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Hi,

    I have sent you a private message with help.

    Thanks for watching! :)

    Best,

    Jon
     
  30. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    (bookmarked)
     
  31. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    thank you! :)

    Also massive UPDATE!

    The website is live, and you are free to subscribe so you can receive release date information!!

    Check it out: http://DigitalGamingInstitute.com

    Don't worry about having to confirm the email that's sent. All accounts are automatically listed as confirmed in the settings! Stay tuned. Thanks for watching!!
     
  32. TheMitic93

    TheMitic93

    Joined:
    Jan 11, 2013
    Posts:
    10
    links are wrong for tutorials, when i click on tut3 it opens space shooter series :(

    EDIT:

    Oh now i see, there are actually 2 tutorials and then goes space shooter project :D
     
    Last edited: Nov 15, 2013
  33. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Yes, they are separated by project based tutorials, and standard tutorials.

    Thanks for watching!
     
  34. deimaytee

    deimaytee

    Joined:
    Nov 13, 2013
    Posts:
    4
    SubZeroGaming <------- you are one hell of a guy . You have restored faith in the fact that I can do unity and my dissertation wont be a complete failure . Your tutorials are detailed and the most important bit You explain each method and when and why you use it . Keep up the good work mate you will get far in life :).
     
  35. Lisa_Lingoes

    Lisa_Lingoes

    Joined:
    Oct 7, 2013
    Posts:
    3
    I love this series. I've taken a gaming class where we created a "Survival Island" game, however, there wasn't much interaction of a do it yourself nature. we created it directly from the instructions in the book so even though I typed out the code (using JS), I didn't understand it or what it did....I am starting to understand more because of your tutorials...Keep up the great work and I look forward to more tutorials. :)
     
  36. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Thank you very much! :)

    Thank you as well! Glad you are enjoying them. Make sure to check out http://DigitalGamingInstitute.com and follow on Twitter @DGIStudents

    Best,

    Jon
     
  37. MilitaryGames

    MilitaryGames

    Joined:
    May 24, 2013
    Posts:
    26
    This is a great tutorial series. I've learned more here than with any other tutorials. The interactive part is what makes this stand out.
    Thanks!
     
  38. MitzeMitchell

    MitzeMitchell

    Joined:
    Dec 2, 2013
    Posts:
    4
    This is absolutely fantastic. I've been following through various tutorials I've found around the web, but never felt like I truly learned anything. I only ever ended up with a copy that I didn't really know how to edit.

    Now...if I can only figure out how to get off work so I can watch more. Hmmm...
     
  39. ashley

    ashley

    Joined:
    Nov 5, 2011
    Posts:
    84
    I know you're super busy with the site and everything at the moment, but just wondering if you had any intentions of doing any videos relating to the recently released 2D framework? I've found your videos useful and I know there are a lot of similarities, but would be good to have some 2D-specific videos if possible.

    Cheers.
     
  40. SpencerN

    SpencerN

    Joined:
    May 5, 2013
    Posts:
    18
    I plus 1 this.
     
  41. Ryza

    Ryza

    Joined:
    Dec 21, 2013
    Posts:
    7
    Wow thanks for this :)
     
  42. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Thank you very much! Glad you enjoyed them.

    Ha, thank you very much! :)

    Hi,

    Yes, I do have a course set up using the new 2D framework that will be freely available on Digital Gaming Institute. I'm working with a local artist now to provide actual artwork rather than just colored cubes ;)

    Thanks for watching!

    :) You got it.

    Of course. Glad you enjoy the vids. Thank you!

    Best,

    Jon
     
  43. kkcy

    kkcy

    Joined:
    Dec 23, 2013
    Posts:
    1
    Great tutorials! Haven't actually dive into them deeply yet but will do in the next couple of days.
    Thanks for your hard work!
     
  44. minato20dz

    minato20dz

    Joined:
    Jun 23, 2013
    Posts:
    2
    thanks man your tutorials are really amazing it was not hard to understand
     
  45. yoyoguyss1

    yoyoguyss1

    Joined:
    Jan 2, 2014
    Posts:
    5
    Am I supposed to have prior knowledge , this tutorial looks nice but is this for beginners and by learning to develop these games on your tutorials help me build apps with C# ? Please change the your first video IF its for beginners why not add info on what your using to add the things your using like player movement etc the code what you write on , I am assuming your using unity but make a video on how you get it set up and started etc only if its for absolute beginners ........
     
    Last edited: Jan 2, 2014
  46. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Hi Yoyoguyss1,

    My apologies for the inconvenience. My series is aimed at those programming with Unity as a beginner. It's expected that you are comfortable moving around your scene and familiar with the editor options. It's also assumed knowledge that you are comfortable with the most basics of C#. This includes variables, if statements, and if-else statements. If you understand those 3 concepts, then my series is pretty easy to follow along. The idea is that you learn to create content on your own through open discussion and pseudo code.

    If you are looking for help with the unity editor, I suggest searching on YouTube for a tutorial of it, and if you're looking for the fundamentals of C#, Acem Gaming demonstrates the use of each C# concept. You only need to watch the first five of his videos to be prepared for my course.

    Take a look at my signature for links to get you started.

    Best,

    Jonathan
     
  47. yoyoguyss1

    yoyoguyss1

    Joined:
    Jan 2, 2014
    Posts:
    5
    Ah I see thanks for the info I can't really seem to find any video teaching you how to use UI (User interface) of the Unity game editor although really don't care I am just gonna get used to it by using it , I already started viewing the tutorials and its really good and one more thing you never did answer the question by following the tutorials I will be able to make Apps and software not only games right? I am trying to become a developer for Meta (virtual glass like Google glasses Google it if you don't know what it is..) and makes apps etc for it.
     
  48. SubZeroGaming

    SubZeroGaming

    Joined:
    Mar 4, 2013
    Posts:
    1,008
    Hi,

    This course is mostly for game development, but you can certainly take the knowledge learned and create applications with it. If anything, this course will help you think through the logic of how certain functions of a program work and how you can break the problem down so it's easier to solve. But overall, this is specifically towards game development.

    Best,

    Jon
     
    Last edited: Jan 3, 2014
  49. yoyoguyss1

    yoyoguyss1

    Joined:
    Jan 2, 2014
    Posts:
    5

    Ah I see thanks I will still continue as the knowledge can still be used for app development as you said , Thanks a lot for the replies and keep up with the good tutorials
     
  50. ashley

    ashley

    Joined:
    Nov 5, 2011
    Posts:
    84
    Glad to hear and I'm looking forward to it :)

    Out of interest, do you still offer private tuition (for a fee, obviously)?