This Is Why You Can’t Figure Out Programming In Unity! (C# Tutorial)

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

ความคิดเห็น • 81

  • @ButWhyLevin
    @ButWhyLevin  2 ปีที่แล้ว +3

    Go to my sponsor snhu.edu/levin if you’re interested in starting a career in game development!

  • @HoodedOlive
    @HoodedOlive 2 ปีที่แล้ว +84

    One thing I would suggest when learning how to code is if you use a tutorial try and break the code down to try and figure out how it works and how you could use different bits of it for different uses. When I started that was a pretty easy way to find things I didn’t understand so I could go research them and figure it out.

    • @user-zu1ix3yq2w
      @user-zu1ix3yq2w 2 ปีที่แล้ว +1

      Suggestion 2: chemical enhancements? Might help motivation for all that research

  • @peanutgamerguy8685
    @peanutgamerguy8685 ปีที่แล้ว +14

    Another great tip for debugging is to use breakpoints in code, allows you to step through code one line at a time. This is a great way to figure out when something breaks, also saves you having to write Debug.Log everywhere in your code.

  • @silvertheelf
    @silvertheelf 3 หลายเดือนก่อน +2

    Here’s a few tips I have;
    If you want to learn code, the best way is to write everything down you need to know in a note, making notes outside of coding which details information like how code behaves on its own, how it interacts with other code, and so on, can be somewhat helpful.
    Another thing is to learn a game engine, something I am pulling from another person, Binzu Dev, another person on TH-cam, is “Make a game to learn the system, don’t learn the system to make a game” which basically means if you want to learn a system, make a simple game in it as your learning it, without using tutorials to tell you exactly how to do things preferably as tutorials are generally not helpful if you view them as something to copy paste.

  • @SuperDutchrutter
    @SuperDutchrutter 2 ปีที่แล้ว +6

    Good video. Learning how to learn really IS so important. It took a few gos for Unity to really click with me but now I’m hooked!

  • @monstereugene
    @monstereugene 2 ปีที่แล้ว +19

    I used to want to learn unity but as a kid with free time it’s be better if i learn normal C sharp then unity

  • @Skeffles
    @Skeffles 2 ปีที่แล้ว +3

    Neat video! Identifying your shortcomings as a dev and learning how to improve is always key.
    I'd like to suggest looking into automated testing to help your debugging process. Being able to run a suite of tests to confirm everything is working is much faster and easier than having to manually play test. For example if you have a test for your DoExplode function. One test passes in Big explode and one test passes in Explode, you'd find out that code isn't working as expected. After some inspection you'll realise the parameter isn't being used.

  • @Joso997
    @Joso997 2 ปีที่แล้ว +6

    Don't repeat yourself is a given, but what you really should keep an eye on is a program in a way that the thing you are changing the value of can only be done in one way (preferably a functional pipeline).
    Following this rule, you will be able to get the complete response from an error, from the point an action originated, through every function it passed through, and what it ended up breaking.
    Example: Firing a gun can only be done in the Gun script. Once the bullet in whatever way reaches a target, what you want to do is make the health script detect it was shot at, decreasing the object's health. You must not allow the Gun script to access any of the health script properties and you must not allow the Health script to access any property of the gun script. Also, try to use functions for every variable change.
    Try to not make anything accessible globally, you really don't need global access to anything. It may be easier until you develop a certain way of thinking, it is an old concept that is fine to use in embedded systems but not in any of the new programming languages.

    • @Joso997
      @Joso997 2 ปีที่แล้ว +2

      @@kidmosey "If you require the health script to know every type of object or interface that can affect health"
      It doesn't need to be in a health script, but yeah you should have everything written down somewhere, preferably in the code. Or if you want to change it afterward without building the whole game, in a JSON or similar...

  • @jasomega2446
    @jasomega2446 ปีที่แล้ว +2

    6:42 Well said

  • @Joso997
    @Joso997 2 ปีที่แล้ว +13

    Unity tips:
    Try to use Unity API code instructions as less as possible. You only really need it to interact with the physics engine.
    Challenge yourself to use the least amount of update calls.

    • @Joso997
      @Joso997 2 ปีที่แล้ว

      Keep in mind that enter Trigger and similar functions are almost the same as an update. Preferably work without them, use events.

    • @dnoldGames
      @dnoldGames ปีที่แล้ว

      I mean you probably want the most amount of update calls possible if you look at that way

  • @gluckes
    @gluckes ปีที่แล้ว +1

    here's another simple tip: write your code in a way that a human can understand it. on top of splitting things off for re-use, use proper naming for variables, functions and classes. this way you don't have to traverse the code to see what this dothing(int something) does and why, it's also a lot clearer for others if you ask them for help and show them your code.

  • @Jiovi
    @Jiovi 2 ปีที่แล้ว +1

    I start learning Unity and C# one month ago, and the best way i took to learn, are the gameJams.

  • @omle8492
    @omle8492 ปีที่แล้ว +2

    Great video!
    Sorry bro I had to bring it up. Please use serialized fields. Its sorta bugging me. Sorry!

  • @Connorses
    @Connorses ปีที่แล้ว

    This video needs a section on breakpoints. You can literally mark a part of your code and when the debugger gets there, it will help you step through your code and see what's really happening and even peek at the values of variables. It's insanely useful and I didn't know about it for years.

  • @mancheckitout
    @mancheckitout 8 วันที่ผ่านมา

    Thank you!

  • @Jrej_dev
    @Jrej_dev 2 ปีที่แล้ว

    Already a developer so I knew most of that. I use JavaScript and getting into Godot's GDScript though. Code is different but fundamental do not change.

  • @isaacashton5772
    @isaacashton5772 9 หลายเดือนก่อน

    Adam C Younis is my best advice

  • @MasterProgrammer423
    @MasterProgrammer423 5 หลายเดือนก่อน +1

    My only problem is finding an actual good video to learn Unity

  • @ancientbeing9720
    @ancientbeing9720 ปีที่แล้ว

    if theres one thing ive learned its that brackeys is THE KEY

  • @GabCom888
    @GabCom888 9 หลายเดือนก่อน

    You just won a subscriber

  • @johngrey5806
    @johngrey5806 7 หลายเดือนก่อน

    Liked, subscribed, and commented.

  • @lightless
    @lightless ปีที่แล้ว +1

    Its important to write relevant, efficient code too. Also only write objects in Pascal Case and in python its snake. In compiler languages its typically camel case. I am doing a degree and i watch the other students write the same code over and over and i die of crippling dispair lol 😂

  • @TriggerWarningStudios
    @TriggerWarningStudios ปีที่แล้ว

    Excellent video

  • @staticplays1871
    @staticplays1871 ปีที่แล้ว +5

    I'm going through the unity beginner scripting for like the 3rd time, and I was wounding. what am I meant to remember, I'm trying to understand literally anything and I don't know how to practice, and I'm worried about forgetting things that i might need to know later and I'm worried that if I can understand what to do, whenever I watch a tutorial, that I will be afraid that I can put my own spin on things or really understand what people are teaching me. so, what do I do?

    • @gamesbyzeta1434
      @gamesbyzeta1434 ปีที่แล้ว +6

      So, the best advice i can give for this.
      1) Don't be afraid of forgetting things. the things you might forget are going to be things you can always google up. there is no punishment other than time spent relearning things. so there's nothing to be afraid of.
      2) for learning how to put your own spin on things. rather than following the tutorial directly, what i have done is only look up tutorials for things i'm needing in my current project and looking into how they worked on it. because my systems are different. so i *have* to adjust things.
      3) practice is actually quite easy. you remember how math class always started you with the easy stuff and built it up over the year? same thing here. pick a random shitty mobile game that you can think of that has the least ammount of depth you can think of, and just recreate those to start with. and you can slowly build up your familiarity with both unity and c# and by the time you've got like 5-10 of those done, you probably picked up enough to move onto more interesting projects.

  • @MusselPump1
    @MusselPump1 2 ปีที่แล้ว +2

    I would say that when you learn anything with code you should probably stop thinking about the application at first and focus on the idea of what you need, then focus on the application

  • @pirateskeleton7828
    @pirateskeleton7828 ปีที่แล้ว +1

    When looking for bugs, more often than not, if the game was stable before you added a new feature, and now it’s buggy, the bug is in some way related to the feature. This would seem obvious, but…

  • @amanammer
    @amanammer 2 ปีที่แล้ว +4

    i have given up on learning engined other from scratch since unity dint work for me and it wont let me instal unreal

    • @ButWhyLevin
      @ButWhyLevin  2 ปีที่แล้ว +2

      Try out Godot, it’s free and really easy to run, and probably the best 2d engine out there

    • @amanammer
      @amanammer 2 ปีที่แล้ว

      @@ButWhyLevin will do! Thanks

  • @maddoxreuter7404
    @maddoxreuter7404 2 ปีที่แล้ว

    you're the man!

  • @JonHuhnMedical
    @JonHuhnMedical ปีที่แล้ว

    I inherited a massive unity project on my job that has thousands of lines of code and literally not one line of documentation. My frustration level is through the roof.

  • @jigarpanchal0
    @jigarpanchal0 ปีที่แล้ว

    One things i learned is that you can't just learn something just like that let me explain for example you wanna learn scriptable object you go and watch some video and you forgot everything but suppose you working on game and you need scriptable object but you don't know about it so you just type something like how to reduce memory footprint in unity and you'll end up to scriptable object you implement it in your project and you just learned scriptable object in such way that you will be able to use it many time in many other projects you would have understood it very very well

  • @blasterxt9
    @blasterxt9 3 หลายเดือนก่อน

    Learn the basics of the program and understand the api of the game engine .

  • @HLCaptain
    @HLCaptain 2 ปีที่แล้ว +1

    1:37 you don’t even use the radius parameter…

  • @leenadhimte3099
    @leenadhimte3099 ปีที่แล้ว

    How to identify which code we should use to do what we want in unity

  • @videogamestutorial
    @videogamestutorial 2 ปีที่แล้ว

    Why when I update my unity it says error on my game codes

  • @HoodedOlive
    @HoodedOlive 2 ปีที่แล้ว +5

    It’s pretty crazy that a university is sponsoring TH-cam videos.

    • @RedCroissantGames
      @RedCroissantGames 2 ปีที่แล้ว +1

      He’s just that good

    • @HoodedOlive
      @HoodedOlive 2 ปีที่แล้ว

      @@RedCroissantGames And now in his next video the entire state of New Hampshire is going to sponsor him as the logical next step.

    • @RedCroissantGames
      @RedCroissantGames 2 ปีที่แล้ว

      @@HoodedOlive nah, you arent thinking big enough
      not only will this man sponsor himself, so will all 49 us states

    • @HoodedOlive
      @HoodedOlive 2 ปีที่แล้ว

      @@RedCroissantGames there are 50 states

    • @RedCroissantGames
      @RedCroissantGames 2 ปีที่แล้ว

      @@HoodedOlive south carolina isnt real

  • @a.medition2464
    @a.medition2464 ปีที่แล้ว

    bro I have become very very much confused by seeing very much tutorials on my screen. I don't know which video should I watch. I know how to use unity but i am trying to become professional in C# with unity so please help me how could I learn C# UNITY ? PLEASE 🥺

  • @DevlogBill
    @DevlogBill ปีที่แล้ว

    Hi ButWhyLevin, I think the issues with me isn't programming, been programming with JavaScript and Kotlin for Android for almost 2years now. Made a couple of crappy little projects and now working creating an Android app. Most people aim at creating a ToDo app. But I figured why not try and make a game on Android?
    As a hobby I would really like to create a 2D action fighting game. But the biggest challenge for me isn't coding the hard part is I can't draw! I figured maybe I could create pixel game character sprites? Or does Unity come with free available characters?
    Lastly, for Android should I go with Unity or Unreal? Or maybe Godot? Which would you recommend for a simple 2D indie action fighting game?

  • @troyna77
    @troyna77 ปีที่แล้ว +1

    The Biggest Problem in the world is understanding the terminology AND having the terminology remain consistent over multiple sources.

  • @Aidanryry
    @Aidanryry 2 ปีที่แล้ว

    BriefWhyLevin

  • @massilyar341
    @massilyar341 ปีที่แล้ว

    Can I use python on unity in some way

  • @general1983
    @general1983 ปีที่แล้ว +1

    JUST LOOK GYUS any one can learn how to code and also any can learn any thing but u just give a tray don't glow in thing if you don't like I don't know why every one say go and learn programming if there is a good person on some thing doesn't mean it good for u just give a tray don't glow also don't fkn sleep

  • @kingofroms7224
    @kingofroms7224 2 ปีที่แล้ว

    cool

  • @staticplays1871
    @staticplays1871 ปีที่แล้ว

    How do I use Google. I know I'm not supposed to copy from Google but then how to people use it

    • @ButWhyLevin
      @ButWhyLevin  ปีที่แล้ว

      Copying is fine, just try to make sure you know what the code that you just copied actually does

    • @staticplays1871
      @staticplays1871 ปีที่แล้ว

      @@ButWhyLevin ohhhhhhhhhhhhhhhhhhhhh. That makes more sense

    • @staticplays1871
      @staticplays1871 ปีที่แล้ว

      @@ButWhyLevin what if I don't know where to start. Like in not a compleat noob at c# I know the basics like int, float, if statements, and transform.position but I have a hard time puting them into actual practice and making them better at it goes on.
      For example, I can code basic movement, with the player rigidbody, or their transform but I can't properly expand on to have things like drag, and max speed and double jump. Like I have a vague idea of how to do them. Like if I did double jump I would check key input, and for max speed, I might use a function that adds speed overtime until the player stops things like that but no clear vision.

  • @RiotDarkside
    @RiotDarkside 10 หลายเดือนก่อน +31

    This video is 99% filler don't waste your time

    • @Krullenbol010
      @Krullenbol010 5 หลายเดือนก่อน +6

      No, this video actually teaches you how to learn. Don’t follow tutorials blindly but actually learn the programming language by searching up the api.

    • @Expectrø_5
      @Expectrø_5 5 หลายเดือนก่อน +1

      Agreed ​@@Krullenbol010

    • @Raevolpe
      @Raevolpe 3 วันที่ผ่านมา

      ​@@Krullenbol010Yep, filler as he said, anyone with more than 2 IQ knows everything he said, it's just common sense

  • @rawkth5996
    @rawkth5996 2 ปีที่แล้ว

    I feel like you really just want to make an open-world taxpayer game and write your story (and prob everyone's story) about how you struggle with taxes and the "epic" journey it takes to get the money to pay them and just the paperwork in general. lol.

  • @rawkth5996
    @rawkth5996 2 ปีที่แล้ว +1

    OKAY advice from a noob for fellow noobs and even devs GET GREPPER for fuck sakes get it most of your problems can and will be solved with it and it's free, like I was having trouble trying to set up a scene swap through a button press code script couldn't find anything that works and boom Grepper instantly gave me the answer to my problem instantly. Like wholly shit I was stuck on this problem for a while and youtube tutorials and even unity API did jackshit for it.

  • @Joso997
    @Joso997 2 ปีที่แล้ว +1

    One of my comments got removed 🤷‍♀

    • @humadi2001
      @humadi2001 2 ปีที่แล้ว

      Is it because of his thumbnail😂

    • @Joso997
      @Joso997 2 ปีที่แล้ว

      @@humadi2001 em no?

  • @Greviouss
    @Greviouss 11 หลายเดือนก่อน +1

    Call me racist bigot if you want but do you know who you dont see saying "i cant learn to code its hard"
    Asians.
    Let that sink in.

    • @bminecreeper
      @bminecreeper 4 หลายเดือนก่อน

      Racist bigot

  • @Project68K
    @Project68K 2 ปีที่แล้ว +1

    I'm sorry, but how does a programmer not know that an API stands for "Application Programming Interface". That should be one of the most basic things any programmer should know.

  • @joevaghn457
    @joevaghn457 ปีที่แล้ว +1

    Honestly, I can be empathetic sometimes, but I swear I fail to understand why programming is so hard to some people. The core concepts are so simple to grasp, but maybe people are lacking experience…? I genuinely can’t get it. The only things I find relatively difficult are coming up with solutions to problems or remembering enough library stuff to do what I need. But programming, like understanding the language? Nope. Incredibly easy. I think the ones not getting it are lacking functional experience, as in seeing their code do what the want it to do. They might actually be afraid of errors, but errors are how you learn how to figure out how to do what you need. Errors and mistakes can (typically _are_) the best mentors.

    • @rr9674
      @rr9674 ปีที่แล้ว

      Some of us have never coded a bug dummy