You NEED to know this! - Master debugging in Unity & C#

Поділитися
Вставка
  • Опубліковано 10 лис 2024

КОМЕНТАРІ • 135

  • @aarongeorge347
    @aarongeorge347 2 роки тому +103

    Does exactly what I do for debugging and then says “But let’s try not to be noobs for a second” and I gotta say I felt personally attacked.
    But after this video, that’s the old me. And the new me does indeed love you long time. Thanks so much for these tutorials! They are the perfect collection of content for beginner-intermediate game devs and definitely help to bridge that experience gap!

    • @moldman5694
      @moldman5694 Рік тому

      Literally me. I've been doing Debug.Log() for ages knowing that there's probably a better way but just never looking for it, until now. I even knew about breakpoints and had used them elsewhere in non-Unity related programming, but I never knew you could integrate them with Unity.

  • @brettabraham
    @brettabraham 2 роки тому +10

    THANK YOU. I have tried to use breakpoints in VS but didn't know we had to "Attach to Unity" so it just never worked. I kept telling myself that "one day" I'd figure out how it works but never got to it.
    So simple and very, VERY helpful

  • @Hassanali-jr4yb
    @Hassanali-jr4yb Рік тому +3

    Can't thank you enough , these videos are helping so much in understanding how to not be a beginner, I never knew these tools existed and doing development for 2 years and game dev for 5 months , your are a very valuable unity youtuber, keep enlightening our paths with your priceless wisdom.

  • @larryd9577
    @larryd9577 3 роки тому +27

    Error messages are usually very descriptive. You just need to learn to look out for the good parts of it. The error message at 1:10 says that the NRE occurred in Shapes.cs:18 that means line 18. And the single place where this could have occurred is when accessing _shapeList and it being null.
    Debugging is nonetheless an invaluable skill. One extra trick: you can right-click the break points and add an condition under which it will stopp the programm execution there.

    • @LyrelGaming
      @LyrelGaming 2 роки тому +9

      Error messages are actually descriptive and debugging is an awesome skill to have.
      But the script he used is just for demonstration purposes. He made it intentionally just a few lines of code to demonstrate the debugger power not the actual error cases.

  • @johnrex7108
    @johnrex7108 Рік тому +1

    Great tutorial, Taro. Been having a lot of trouble recently trying to find out why I wasn't seeing local variable values show up in my debugger in visual studios and this really helped.

  • @uncleared8516
    @uncleared8516 3 роки тому +5

    Just discovered this video! Didn't know about the step bugger and how essential it is till now! Thanks for covering it

  • @axeldabee8763
    @axeldabee8763 2 роки тому +3

    Hey man, I love your channel, but I wanted to write a negative because the title promises me some extra tips for debugging and shows mainly basics.
    But man, I didn't know you can drag the debug arrow in VS Code. I've 4 years unity hobby experience and didn't know this. You changed my life mate!!

  • @libberator5891
    @libberator5891 3 роки тому +12

    5:40 I was like, I don't have an 'eleven' key 😅
    Good tutorial! I usually do the Debug.Log workflow but I'll have to use this more often

    • @Tarodev
      @Tarodev  3 роки тому +1

      Oh damn haha. My bad!

  • @BujGames78
    @BujGames78 Рік тому

    Tiny pro tip I learned a while back. In Unity when You got yourself an error , double-clicking on IT will not always take You to the exact source of the error. If You just click on it once, IT will bring up details . You will notice some blue links that take You to diffrent lines of code in your faulty script . Clicking on the top blue link will take You to the exact line that caused the error . You can acutally see this in Tarodev's demonstration of the NullRefrenceException. One of the blue links indicates line 18.

  • @larrypendleton8195
    @larrypendleton8195 3 роки тому +19

    This is good stuff. I would like to see more of these types of videos. I program and rarely use the debugging tools, but this is a great start for me to change the way I test code. Would be great to see debugging in larger code examples. Thanks

  • @jamppajoo94
    @jamppajoo94 2 роки тому +5

    Holy damn. After 5 years of Unity I thought that knew something about debugging the code but seems that I was wrong :D I rarely use script debugging since most of the games I'm working is highly dynamic. It's hard to see what number is wrong if you have to continue the code for the next 60 frames for it to happen. For those cases i use conditional breakpoints. If you right click a breakpoint, you can add a condition on when that breakpoint is fired.

  • @elronaldopablo
    @elronaldopablo 2 роки тому

    I clicked on this video thinking, "Alright, let's hear this one." as I've been watching/listening to videos trying to polish up on my draw calls, optimization and frame debugger knowledge.
    Then I heard, "...but you'll love me long time..." XD
    Had to replay just to be sure. Hilarious! I'm all ears now!
    Hello there from a soon to be Technical Artist for a studio in Montreal!

    • @Tarodev
      @Tarodev  2 роки тому +1

      Best of luck on your journey my man!

  • @karthiknallan559
    @karthiknallan559 2 роки тому +1

    This looks like such a lifesaver, excited to use it now

    • @Tarodev
      @Tarodev  2 роки тому +1

      It will make your bug squashing experience much smoother 😉

  • @ishan9050
    @ishan9050 2 роки тому +1

    Yeah man that's real juicy, specially controlling the flow part

  • @Caphalem
    @Caphalem 3 роки тому

    Ok, dragging the Debug Step genuinely blew my mind :D

  • @breakdancerQ
    @breakdancerQ Рік тому

    Thanks man, simple. clear, and not too long!

  • @notDiru
    @notDiru 3 роки тому +2

    Exactly what I was looking for once again

  • @Gregasaurus
    @Gregasaurus Рік тому +1

    subscribed. love your vids mixture of info and "love you long time"

  • @Notreal76
    @Notreal76 Рік тому

    Always learning new stuff from you. Thank you!

  • @overrideFunction
    @overrideFunction Рік тому

    Didn't know you could drag that pointer. Very cool!

  • @Darrend2
    @Darrend2 2 роки тому +1

    Thank you for making this video

  • @jaydekemsley2594
    @jaydekemsley2594 2 роки тому

    It's rare to find someone who knows the field you are studying and also understands good teaching methods. I just spent an hour stumbling through various debugging tutorials, every one of them had me straining to follow or included only a portion of the info required.
    Then I found this, and it was perfect. I understood everything clearly on the first run through.
    Thank you for taking me from "debug.log" to real debugging in just nine and a half minutes!
    #subscribed

    • @Tarodev
      @Tarodev  2 роки тому +1

      I'm so glad I could provide what you needed 😂 happy debugging

  • @eGregiousGames
    @eGregiousGames 2 роки тому

    I love the way you explain stuff and the quick nature of your videos. Just thought I'd drop a positive comment because your channel is fast becoming invaluable to my learning!

  • @UnpopularOpinionGames
    @UnpopularOpinionGames 2 роки тому +1

    A worthy sucessor to Brackeys has emerged

  • @arc5015
    @arc5015 2 роки тому +1

    Damn did not know about moving the arrow to control flow execution, very nice vid

  • @Icewind007
    @Icewind007 2 роки тому +1

    Holy crap. That was a lot of stuff I learned there.

  • @mooumari8210
    @mooumari8210 3 роки тому +1

    Amazing video as always

  • @Paul-zh2jp
    @Paul-zh2jp 3 роки тому +1

    Just found your content today. Good stuff!

    • @Tarodev
      @Tarodev  3 роки тому

      Welcome aboard!

  • @buriedomasta3375
    @buriedomasta3375 Рік тому

    thanks man as a beginner this is really helpful.

  • @jahanzeb5751
    @jahanzeb5751 2 роки тому

    Love You for this ❤

  • @nyx0103
    @nyx0103 3 роки тому +3

    "this will blow your tits off". I don't know why but I've been laughing for 5 minutes at that line now xD. Thanks a lot, although I knew about breakpoints, I didn't know that you could redo a part of the code (the yellow arrow). We learn something new everyday.

    • @Tarodev
      @Tarodev  3 роки тому

      Not very family friendly 🤣

  • @lln6123
    @lln6123 Рік тому

    Tarodev first choice!

    • @lln6123
      @lln6123 Рік тому

      Really, what a great tutorial...!
      Now I start recognizing why VS might be better than VSC

  • @AN_DigitalDev
    @AN_DigitalDev Рік тому

    Great tutorial, thank you :D

  • @pelotoncio
    @pelotoncio 2 роки тому +1

    gotta love the 'try no to be noobs for a second' mindset

  • @eugenekiyamov8917
    @eugenekiyamov8917 Рік тому +1

    thank you!

  • @noobcraft5712
    @noobcraft5712 3 роки тому +1

    Finnaly watched this :)

  • @narkopraxis602
    @narkopraxis602 3 роки тому +2

    This was a great reminder.... Somehow I got out of the habit of using debug mode.

    • @kingbling7571
      @kingbling7571 3 роки тому +2

      Which means ur code is always perfect? You won but at what cost?!!

    • @narkopraxis602
      @narkopraxis602 3 роки тому +2

      @@kingbling7571 I wish... Really it means that for a time I was forced to develop in an environment that didn't have live debugging and now I forget it exists...

  • @thecoweggs
    @thecoweggs 3 роки тому +1

    Probably never gonna use but bookmarked. looks so useful

    • @Tarodev
      @Tarodev  3 роки тому +1

      If you plan to be a prigrammer, you'll most certainly use debugging sir

    • @thecoweggs
      @thecoweggs 3 роки тому

      looks like a pain to setup lol. i prefer the general way

    • @nyx0103
      @nyx0103 3 роки тому +1

      @@thecoweggs if you've installed Unity correctly, this is actually really easy to achieve and less work than writing 1000 Debug.Log. Click on the line you want to add a breakpoint, press F5, press Play in Unity, voilà, you're now debugging.

    • @gamedevplayer
      @gamedevplayer 3 роки тому +1

      @@thecoweggs u know nothing of pain my friend

    • @thecoweggs
      @thecoweggs 3 роки тому +1

      i do, ive spent 3 hours debugging a single error :(

  • @bloodlinegaming9962
    @bloodlinegaming9962 2 роки тому +1

    you got my like, share, sub, and first born if it is your desire MASTER

    • @Tarodev
      @Tarodev  2 роки тому +1

      Aww babe 🙏

  • @youtuber9991
    @youtuber9991 2 роки тому +3

    Any idea on how to debug a specific instance of a script? For example say you have a car driving script that's applied to multiple cars in the scene, how can you isolate the debugging to a single script instance (in this case just a single car script)?

    • @Tarodev
      @Tarodev  2 роки тому +6

      If there is some kind of unique identifier from car to car, set your breakpoint and then right click it to add a condition. You could do if("car a" == _identifier). I didn't actually show this in the video, but it's an amazing feature.

  • @bemistertessema573
    @bemistertessema573 Рік тому +1

    Where have you been all my life.

  • @Izzy-fr1zu
    @Izzy-fr1zu 2 роки тому +1

    9:09 Not a boy, but liked your video anyway, cause I'm a rebel :p
    Thank you! This was helpful!

    • @Tarodev
      @Tarodev  2 роки тому +1

      Oi! Take that like back. Boys only!
      Jks, thank you :)

  • @Ryöken17
    @Ryöken17 3 місяці тому

    If you code by understanding how code works and not with only memory, you can do the same thing with your brain and read the code like this without needing this.

  • @DarkzarichV2
    @DarkzarichV2 2 роки тому +1

    Actually expected to see debugging with gizmos, showing debug info in the game and stuff

    • @Tarodev
      @Tarodev  2 роки тому +1

      Nope! I do have a gizmo's video though

    • @DarkzarichV2
      @DarkzarichV2 2 роки тому

      @@Tarodev Nice! I'll check that one for sure.
      Btw do you ever plan on making a video about shaders, post processing and all that stuff? I'd really like to know how is done something anime style looking games, carton like 3d objects, maybe something like borderlands 3d. It's really cool

  • @Jarzykk
    @Jarzykk 2 роки тому

    Thank you. Great chanel

  • @tane4305
    @tane4305 Рік тому

    GOAT

  • @evanroderick91
    @evanroderick91 2 роки тому

    I'm looking forward to doing this, but when I attach to Unity, Visual Studio 2019 shows like 4,000 errors then pops up a window saying "There were build errors. Would you like to continue and run the last successful build?"

  • @ponadchmurami8008
    @ponadchmurami8008 Рік тому

    thanks man

  • @AlexTuduran
    @AlexTuduran Рік тому

    While debugging, how do you tell Unity to advance one frame, so that you can see in the game window a change that you've made on the fly?

  • @mrslake7096
    @mrslake7096 3 роки тому +1

    Thx

  • @belgianwizard6114
    @belgianwizard6114 2 роки тому +1

    THIS IS HUGE. Thank you so much man!

    • @Tarodev
      @Tarodev  2 роки тому

      Life changing knowledge ;)

  • @patrickmacmurchy1809
    @patrickmacmurchy1809 3 роки тому

    Is it possible to do things like..tinker with vector math while in a breakpoint? For example just something like evaluating `Vector3.forward * 5` ?

  • @Виктор-ъ4ь8л
    @Виктор-ъ4ь8л 3 роки тому +1

    🔥🔥🔥

  • @insigpilot
    @insigpilot 2 роки тому

    I learn something new every time I watch your vids. Excellent for a beginner to game dev like myself.

  • @codycanipe4415
    @codycanipe4415 Рік тому

    Hey man, really great video! I noticed your script don't recompile when you hit play. Is there a trick to it? Seems like it would save a lot of time!

  • @qwertyram4598
    @qwertyram4598 3 роки тому +1

    Not sure if these are still worth to watch when I have switched to Godot, but these more general programming tutorials seem fun

    • @Tarodev
      @Tarodev  3 роки тому

      Have you enjoyed the switch? Also, why did you switch?

    • @qwertyram4598
      @qwertyram4598 3 роки тому +1

      @@Tarodev I'm not surr yet, it does seem a bit easier to just make something. I switched when I saw it mentioned again, and after seeing its python like language, I was sold...

    • @Tarodev
      @Tarodev  3 роки тому

      @@qwertyram4598 I'm yet to try it out. Might experiment for a week at some point and make a video on my experience.

    • @qwertyram4598
      @qwertyram4598 3 роки тому +1

      @@Tarodev I think it's biggest drawback currently is... the upcoming 4.0 version. It will add so many useful things, especially for 3D, and refine existing features to the point where it could be a solid competitor to other engines, but... Well, it's still in development, not even in alpha.

    • @Tarodev
      @Tarodev  3 роки тому

      @@qwertyram4598 Sounds like I should wait for that!

  • @beavisCZ
    @beavisCZ 3 роки тому +1

    Nice video, but how about debugging android games on phone? I'm not able to connect to my phone via Unity and Visual Studio.

    • @Tarodev
      @Tarodev  3 роки тому

      There are a few extra steps involved in that, but it is possible! Ensure your phone is in developer mode and connected via usb. Alternatively you can connect it via WiFi, but it requires usb initially. Look up 'adb logcat'.
      But any way you spin it, Android development is a more annoying than standalone development. It's made easier by using an Android emulator instead of a real device. Strongly suggested

  • @themaskedcondom2971
    @themaskedcondom2971 2 роки тому

    Quick and to the point. Subscribed.

  • @GrahamOfLegend
    @GrahamOfLegend 2 роки тому +1

    Whoa this was great! I'm def that noob that uses a whole bunch of debug logs, so thanks for teaching this to me!

  • @relentingVids
    @relentingVids 3 роки тому +1

    Super helpful! I definitely learned something new! Thanks!

  • @mrsingh2595
    @mrsingh2595 3 роки тому

    Man hats off to you , never stop uploading the videos, love ur channel, best content, looking forward for more content

  • @manuillo94
    @manuillo94 3 роки тому

    I have never heard of Rada, is that a new IDE?

    • @Tarodev
      @Tarodev  3 роки тому +2

      Can't tell if you're making fun of my Aussie accent or of you've never hears of rider before 😜

  • @jr8209
    @jr8209 Рік тому

    what? "Debugger for Unity" is deprecated and I can't get the "Add to unity button".. that's the problem none of these videos are showing how to fix. In the comments for Debugger for Unity all the latest say the same thing. It is broken and no longer maintained. So what works now?? I just want to be able to step through the code.

    • @Tarodev
      @Tarodev  Рік тому

      You need to install Unity tools for visual studio. Check this video: ua-cam.com/video/5eeI2hWgPbA/v-deo.html

  • @mohokhachai
    @mohokhachai Рік тому

    Reflection in c# tutorial plz

  • @DannyBoy443
    @DannyBoy443 Рік тому +1

    I love the explanation, and I'm trying very hard to follow him, but he lost me when he showed the code and said "Lets not be noobs" because I am still one lol. I need a basics C# Unity course. Does anyone have any good easy recommends? Udemy?

  • @mehdiali8187
    @mehdiali8187 Рік тому

    I knew everything you mentioned but i still for some reason am a noob, well was, Not any more.

    • @Tarodev
      @Tarodev  Рік тому +1

      We all know how to debug, yet still revert to debug logs... the noob will always be within us

  • @playedugame
    @playedugame 2 роки тому +1

    Sir please make unity Android debugging video

  • @TheAntimon13
    @TheAntimon13 2 роки тому

    This was really great! Wished we could have more of those.

  • @gaming4fun419
    @gaming4fun419 2 роки тому +2

    'Man tears' and 'leave a freaking like boys'. Not sure if it's you being transparent about what demographic you want to educate or if it's just a result of the current state of the industry. Just something worth being aware about.

  • @newlinebraces2872
    @newlinebraces2872 2 роки тому +2

    Let's try don't be noobs for a second... ouch burned.

  • @AllExistence
    @AllExistence 2 роки тому +2

    I hoped for something less basic.

  • @michaelmcconnell2943
    @michaelmcconnell2943 2 роки тому

    That indeed blew my tits off. Been programming in unity for many years and had absolutely no idea you could drag the debug arrow around. Love it!

  • @dago6410
    @dago6410 2 роки тому

    I lovecyou but I will keep debugging with debug.logs woth silly text inside the message

  • @brianpurdy2966
    @brianpurdy2966 3 роки тому

    Another great video Tarodev. It is always good to get a refresher on things and this is invaluable to anyone who did not have a full grasp on debugging at this point.
    Keep them coming, Cheers!

  • @betterlifeexe4378
    @betterlifeexe4378 2 роки тому

    Thanks, good video. I bet if I could get a job working in the industry for a while I would pick up a lot of this stuff that I'm just not exposed to.

  • @MrGarkin
    @MrGarkin Рік тому

    "npe is main for devs in general" - not in kotlin and f#.

  • @TheSlapDoctor
    @TheSlapDoctor 3 роки тому

    Yo I subscribed because I like your videos and all, but the clickbait manner of the titles is pretty irritating.

    • @Tarodev
      @Tarodev  3 роки тому +2

      Wow, I changed it to click bait last night and somebody already complained, lol. I'm just going to keep it this way for a few days to see how much difference it makes. Algorithm experiment.

    • @TheSlapDoctor
      @TheSlapDoctor 3 роки тому +1

      @@Tarodev ahh yea I get it, sure it's incentivized. your content is pretty good tho so don't think you need to rely on it too much brother

  • @jolene6911
    @jolene6911 Рік тому

    Apparently the creator of this video doesn’t know that there are women who work in software dev. I am working on a side project and learning Unity and eye rolled at how you talk to your audience. I really hope you don’t use such gendered language professionally. You really need to do better …

    • @Tarodev
      @Tarodev  Рік тому +1

      When over 99% of my audience are male, yes, I use gendered language. Just like if I went to any makeup or fashion channel, I'd be called a girl (but it wouldn't bother me, because I understand it's not malicious)