Unity C# Beginner Tutorial - For Loops with Arrays (Part 07)

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии • 90

  • @aIgojoe
    @aIgojoe 8 лет назад +17

    Just wanted to let you know, your series you made 3 years ago is still helping people like me learn Unity!

    • @KAustinn
      @KAustinn 8 лет назад +2

      Yea he just needs to add a few more videos then make a advanced series

  • @jaydenklein1654
    @jaydenklein1654 10 лет назад +17

    a good tip for anyone making loops in c#: after typing the loop type (ex. for )), hit tab twice and it will give you a template to use it just makes things quicker and easy to remember.

  • @Augmented_AI
    @Augmented_AI 6 лет назад +1

    Really excellent videos!
    Would love to see an advance c# unity course.

  • @TwistedTapeOfficial
    @TwistedTapeOfficial 9 лет назад +4

    Hey man, the last two videos have been great and incredibly easy to follow. I had to rewatch Part 5 about six times before it finally stuck in my brain.
    Keep up the good work, you explain the basics in a very straightforward manner and without going off on tangents about your cat, or postman or whatever. Good stuff! ;)

  • @brabes76
    @brabes76 8 лет назад

    excellent - tutorials so far. this is the first series i have seen that has clicked so far. i think it is super important to know how this stuff works more than just copying code. keep it up.

  • @CrazyKuddie
    @CrazyKuddie 10 лет назад

    These tutorials are great man. Came back to Unity and programming in general after a long hiatus, and this is really helping me out.

  • @HadiExtreme
    @HadiExtreme 10 лет назад

    I used OBS last year to play my PS2 using my computer with a device called an EasyCap, and it was the first software that actually worked properly using avi cables. It worked great not only for playing, but also for recording after I found the right settings (the EasyCap was...difficult to work with, to say the least, and the PS2 has a low resolution).
    My point is, the quality is great in the video. Thanks for this series, and the one where you make a simple game. They are really helpful.

  • @stefanandreasson2385
    @stefanandreasson2385 10 лет назад

    Great stuff man! Love the vids, you're more relaxed and easygoing then most of the tuts I've seen so far so I'm definitely sticking to your tuts!

  • @GOzziTheGermanOzzi
    @GOzziTheGermanOzzi 9 лет назад

    I like your tutorials so far, you explain things simple. Looking forward to all the other tutorials

  • @dewey631
    @dewey631 8 лет назад +3

    Thank you very much :D
    I was watching another Unity Tutorial about making a game in Unity. And in the 6th part, he started coding ... And at that moment, when he just said "So, we will write our programs in JavaScript" i was like "NOOOOOOOOO" so I just moved to this tutorial xD

  • @JacobTalkington
    @JacobTalkington 10 лет назад +1

    Video quality is A-OK. Stick with what doesn't suck! Extremely grateful for the tutorials.

  • @csumityaday
    @csumityaday 10 лет назад

    Thanks for letting us know about the practical implementation of array and loop in game perspective. I really like it and learning a lot watching your series. Recording quality of OBS is pretty good and I have also added you in my google+ circle ^_^

  • @dropdead4423
    @dropdead4423 6 лет назад

    //AwfulMedia !!! Comment Awful Media, not correct name!!
    Debug.Log("Awesome Media);
    If you know what i mean.! Thank you so much sir! People like you are the reason, we can learn everything from our home where education on this subject is not available... you are a legend! We all love you Man !!!

  • @Alfa_Channell
    @Alfa_Channell 8 лет назад

    Hi Austin - love your tutorials - thank so much for doing this!

  • @joemacdonald6312
    @joemacdonald6312 9 лет назад

    Great video Austin! I'm still learning but your videos help a lot!

  • @trinity95624
    @trinity95624 7 лет назад

    So far, so good. Thank you Austin.

  • @MsCrazyboutMusic
    @MsCrazyboutMusic 10 лет назад

    Thanks for your vids, They are really helpful for me that I'm starting in Unity
    Hope I learn a lot with you

  • @heimdyll6090
    @heimdyll6090 10 лет назад

    Something you may want to use is a program titled "Mirillis Action!" It's marketed as a gameplay capture software, but it lets the user do things that usually require multiple programs just within itself. I would highly recommend it as I use it on my secondary account.

  • @spiral2k684
    @spiral2k684 10 лет назад

    Austin i love you, you have a great tutorials!

  • @stefan--
    @stefan-- 9 лет назад

    you appreciate us watching? We appreciate you're helpful videos! Thank you!

  • @kenjoec
    @kenjoec 10 лет назад

    these are great... thanks so much for making these. I have learned so much from you.

  • @aCzylEdits
    @aCzylEdits 10 лет назад +18

    fucking love the quality mate, it's fucking great

  • @dubbacteria8095
    @dubbacteria8095 7 лет назад

    I finally really understand arrays, thanks :D

  • @JRichard112
    @JRichard112 8 лет назад +2

    Fantastic video. Also... "That's an inventory, don't even think about making one just yet." > goes and watches inventory tutorial.

  • @VarunSingh-zb1zx
    @VarunSingh-zb1zx 9 лет назад

    Nice tutorials and I use OBS too for recording my gameplay videos. Its really nice for streaming too.

  • @uhWilliam
    @uhWilliam 7 лет назад

    new to your channels and I love your guides:DD keep it up(Y)

  • @stevie7000yt
    @stevie7000yt 6 лет назад

    I think the new screen recording app is fine, maybe not as sharp as the sucky one to use, but good enough. I'm enjoying following this and getting the C# together - slowly, but with your help, surely. Thanks Austin. BTW, sometimes you sound like Obama - he's a good orator too.

  • @samuelschroder8203
    @samuelschroder8203 9 лет назад

    I can't notice a difference between your screen recording software so if that is easier for you then I think you should use that from my part. Great tutorials by the way!

  • @wach9191
    @wach9191 9 лет назад +3

    Hi. Greate series, I have learned A LOT, but you could also mention how these things can be used in video game development. Thanks!

  • @eyewarsx
    @eyewarsx 7 лет назад

    "I don't want to to think about even making one, but I want you to think about how to make one" Makes sence xD

  • @hasanabir115
    @hasanabir115 5 лет назад +1

    OBS in early 2014, nice

  • @guillermogutierrez5118
    @guillermogutierrez5118 8 лет назад

    This video did not SUUCCKK, Ive seen a lot that just SUUUCKKK LOL. Good Videos man. You have me cracking up at 12:30 tho. Good Work Flow, Good Work Flow Im picking up on this stuff.

  • @hariunity
    @hariunity 11 лет назад +1

    I Am Learning So much from U. Loving This thanks U Are the Best

  • @FUNSTUF456
    @FUNSTUF456 8 лет назад +34

    It's like every episode there are half the views of the last... Everyone gives up so easily... XD

  • @LKBeastGamer
    @LKBeastGamer 11 лет назад +1

    very helpfull tutorials

  • @Doomscizor
    @Doomscizor 11 лет назад +1

    OBS is soooo legit. Also thanks for the tutorials

  • @cornchipss6406
    @cornchipss6406 9 лет назад

    Love the vids keep goin!

  • @richardhawkes
    @richardhawkes 10 лет назад

    I'm enjoying your videos. I think maybe a "while" loop might have been a better starting point for loops. Your explanation (in my opinion) on the "for" loop is quite confusing!

  • @freezone200022
    @freezone200022 10 лет назад

    Best videos ever...

  • @OscarTorresWork
    @OscarTorresWork 7 лет назад

    I have a game im working that will need a loop a for loop. The character unlocks a super mode but I made a parent group which contains the 14 sprites that are full and another set of 14 sprites that are drawn black to appear empty, also each life bar is produced by acquiring 5,000 points. for every 5,000 points he gains a life bar and full l7fe is equaltoo 70,000 points. How can I go aboutthis ive tried switchstatements but thatnever worked out

  • @OmenLW
    @OmenLW 11 лет назад

    If you have to specify the array 'size' in your code (arrayString = new string[2];), then what is the point of having the array available in the editor (Size: 5 - lets you define 5 items for your array)? How do I skip hard coding it and only using the editor?

    • @OmenLW
      @OmenLW 11 лет назад

      Never mind. You just remove: arrayString = new string[2]; and any hard coded array items.

  • @nikolaynikolov6944
    @nikolaynikolov6944 9 лет назад

    Don't worry man! The quality of the video is enough good!

  • @tammyton
    @tammyton 9 лет назад

    Could someone please explain the i++
    I can see what it does, but I don't understand why it's written like that

  • @matthewwheatley
    @matthewwheatley 9 лет назад

    Id like to ask a question that bridges two tutorials. How can i have a script which only stores the array for editing convenience, and use Get.Component or similar to access that array from a class in another script? Any help would be super appreciated.

    • @joaocosta7981
      @joaocosta7981 9 лет назад

      +Matthew Wheatley Still need help?

    • @matthewwheatley
      @matthewwheatley 9 лет назад

      Indeed =( I don't know if I've been searching using the wrong terminology, but I can't find help anywhere.

    • @joaocosta7981
      @joaocosta7981 9 лет назад

      Could you please just simplify ur questio nthen, i didn't quite understand

  • @MarkKeenaye
    @MarkKeenaye 9 лет назад

    arrayString.Length is the number of slots. Is there a way to identify the number of 'filled' slots so the empty ones don't print "Null"?Thanks :)

    • @liamtruter7782
      @liamtruter7782 9 лет назад

      You can go through all the elements using a for loop. For each element use an if statement to test that it is != Null. If that is true, print the element. That should work :)

    • @MarkKeenaye
      @MarkKeenaye 9 лет назад

      +Liam Truter Thanks! Will try it out tonight.

    • @liamtruter7782
      @liamtruter7782 9 лет назад

      +Gen. Mark Keenaye Glad to help :)

  • @yazuki-wolf
    @yazuki-wolf 8 лет назад

    Why`s "i++" make it go up by one each loop?
    Is there a way to make it increase by more than one per loop?

    • @drovijolt7735
      @drovijolt7735 8 лет назад

      +Yazuki Wolf Yes, simply do i += 2. You can change the '2' to any number you prefer. This also works for subtractions (-=),but does not work for multiplication or division. Which I find slightly odd. But I hope you enjoy.

    • @yazuki-wolf
      @yazuki-wolf 8 лет назад

      great. Thanks for the help!

    • @drovijolt7735
      @drovijolt7735 8 лет назад

      Yazuki Wolf Anytime

  • @byteappple
    @byteappple 10 лет назад

    Sup Bro!, can you tell me please why we use in the for loop the letter "i"?? it's confusing!
    Thanks

    • @blufosil11
      @blufosil11 10 лет назад +1

      It doesn't have to be i. I is just an integer that lives solely in the for loop. You could name it int loopCounter = 0 if you wanted to. But then in the second argument you would have to say loopCounter < 10 (or your array length or whatever number you need), and then in the third argument it would have to be loopCounter++ OR loopCounter = loopCounter + 1. So the for loop would look like this: for(int loopCounter = 0; loopCounter < 10; loopCounter++)

    • @byteappple
      @byteappple 10 лет назад

      blufosil Thank you!
      Bests

    • @Tonedefff
      @Tonedefff 10 лет назад +1

      "i" is a convention that's been used in programming for several decades, and in several different languages. It stands for "iterator" as it iterates (fancy word for "loops") through all the possible values. When nesting multiple loops the next letters in the alphabet "j" and "k" are often used. It's one of the only cases where it's considered acceptable to only use a single letter for a variable name. Usually you want to make variable names more descriptive.

    • @byteappple
      @byteappple 10 лет назад

      acrosser8 Thank you very much! :D

  • @jfoster1980
    @jfoster1980 10 лет назад

    I've been watching your tutorials among many others on youtube. My problem is I cannot seem to understand any of it no matter how much I try to engrain it into my brain. Its like trying to speak another language when you know nothing of that language. Can you recommend any books or a reason why I am unable to understand any of this?

    • @sunnylam9902
      @sunnylam9902 6 лет назад

      Might be because your brain wasn't wired when you were younger to process these information. The only thing I can think of is to apply for a program (definitely has to be in real life, not online) and get communication from a tutor. And lots of targeted homework :-)

  • @InkSpacely
    @InkSpacely 11 лет назад +1

    This is kind of the same as visual studio? What's the difference?

    • @InkSpacely
      @InkSpacely 11 лет назад

      C#

    • @InkSpacely
      @InkSpacely 11 лет назад +2

      Ok, thanks and thanks for replying.

    • @ihateyourusernames
      @ihateyourusernames 9 лет назад

      +Mac The text editor he uses in this series comes with Unity, but there are legions of text editors available (eg. Sublime Text, Komodo Edit, Atom...)
      Visual Studio is Microsoft's proprietary text editor. It comes with a lot of great features and I am loving how well it is integrated with Unity.

  • @animaux1999
    @animaux1999 8 лет назад

    What happened with the Channel, it's been a while since the last video :(

  • @NetvorMcWolf
    @NetvorMcWolf 9 лет назад

    When I run the game after making the loop it freezes... My code is here:
    using UnityEngine;
    using System.Collections;
    public class DemoScript : MonoBehaviour {
    public int[] arrayInt;
    void Start ()
    {
    arrayInt = new int[3];
    arrayInt[0] = 10;
    arrayInt[1] = 20;
    arrayInt[2] = 30;
    for (int world = 1; world < 5;)
    {
    print ("Looping!");
    }
    }
    void Update ()
    {
    }
    }

    • @belleluze
      @belleluze 9 лет назад +2

      I think the reason why nothing happens it's because you forgot to increment your world var, I think it's like this
      for (int world = 1; world < 5; world ++)

    • @Jorselfs
      @Jorselfs 9 лет назад +3

      NetvorMcWolf Without the iteration part the loop doesn't stop and causes that Unity freeze because the condition is always true.

  • @lupinder2058
    @lupinder2058 4 года назад

    how can ı optimize a loop system to my script ? After ı clicked button ı can disable my button and after 7 seconds ı can get it back button to game but that functions happen only once. How can script can work all time. Thanks for help. This is very important for me.
    public class Cooldown : MonoBehaviour
    {
    float timer = 0;
    public GameObject Enable_Disable;
    public void Enable()
    {
    Enable_Disable.SetActive(true);
    }
    public void Disable()
    {
    Enable_Disable.SetActive(false);
    }
    void Update()
    {
    timer = timer + Time.deltaTime;
    if (timer > 7)
    {
    Enable_Disable.SetActive(true);
    }

    }

    • @dayls8545
      @dayls8545 3 года назад

      Have you already solved this problem? If so, can you tell me how?

    • @lupinder2058
      @lupinder2058 3 года назад

      @@dayls8545 just add timer=0.0f;. İt will reset Timer and function.

    • @dayls8545
      @dayls8545 3 года назад

      @@lupinder2058 thanks

  • @bender350
    @bender350 9 лет назад

    When i try to do the arrays they won't update to unity and show nothing in the console.
    I don't know what i am doing wrong, i have the code exactly like you in the video, but it still doesn't show the array strings in unity.
    Please help.
    My code:
    using UnityEngine;
    using System.Collections;
    public class Demo : MonoBehaviour {
    public int health;
    public string[] arrayString;
    void start()
    {
    arrayString = new string[2];
    arrayString [0] = "Sword";
    arrayString [1] = "Potion";
    for (int i = 0; i

    • @MarkKeenaye
      @MarkKeenaye 9 лет назад +2

      +Bender The program is case sensitive. "start" and "update" don't exist. "Start" and "Update" do.

    • @baldo8needbelife
      @baldo8needbelife 8 лет назад

      thanks your comments helped

  • @DI2325
    @DI2325 10 лет назад

    it's good)

  • @allancheah368
    @allancheah368 5 лет назад

    Haha that's a good one man! =p
    By the way, is it ok if i can get your advice on these android app below? I am still a beginner and hope to learn from everyone. Your feedback is greatly appreciated!...
    Kindly search ' *pub:Path Ahead* ' in Play Store (P & A are case sensitive).
    thanks and all-the-best !!

  • @dirkpeeters9500
    @dirkpeeters9500 10 лет назад

    totally agree cam studio sucks , this works fine, audacity very good tool and this recording was clear even on a old computer. check out snagit also good for tutorials.

  • @pejmanbehbahani4612
    @pejmanbehbahani4612 6 лет назад

    theres only 5 austin, get it right!