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

Sdílet
Vložit
  • čas přidán 4. 06. 2024
  • Go to my sponsor snhu.edu/levin if you’re interested in starting a career in game development!
    In this video I go over a bunch of tips and tricks that you can use to learn all about getting into programming in unity. I also have linked to a bunch of sources which you can follow for further learning.
    Wishlist Couch Combat on Steam: store.steampowered.com/app/16...
    Join My Pateron for an exclusive Couch Combat Beta:
    / butwhylevin
    LINKED VIDEOS:
    6.Unity C# Tutorial - All About Functions & Parameters
    • 6.Unity C# Tutorial - ...
    Unity Architecture for Noobs - Game Structure
    • Unity Architecture for...
    How to use Unity Scripting API
    • How to use Unity Scrip...
    I Wish I Had Known This Before I Started Unity Game Development...
    • I Wish I Had Known Thi...
    FIX your BUG much faster in Unity! [Simple tricks]
    • STOP Fixing BUGS This ...
    My Discord Server: / discord
    Get the Game: butwhylevin.itch.io/couch-combat
    My Twitter: / whylevin
    Chapters:
    0:00 Intro
    0:36 Basic Principles
    4:14 Learning To Learn
    4:39 API
    5:11 Unknown Unknowns
    6:15 Don’t Waste Time
    7:42 How To Debug
  • Zábava

Komentáře • 71

  • @ButWhyLevin
    @ButWhyLevin  Před rokem +3

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

  • @HoodedOlive
    @HoodedOlive Před rokem +66

    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 Před rokem +1

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

  • @peanutgamerguy8685
    @peanutgamerguy8685 Před rokem +11

    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.

  • @SuperDutchrutter
    @SuperDutchrutter Před rokem +5

    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!

  • @Skeffles
    @Skeffles Před rokem +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.

  • @Connorses
    @Connorses Před rokem

    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.

  • @Joso997
    @Joso997 Před rokem +8

    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 Před rokem

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

    • @therealdnold
      @therealdnold Před rokem

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

  • @monstereugene
    @monstereugene Před rokem +15

    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

  • @Joso997
    @Joso997 Před rokem +5

    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 Před rokem +1

      @@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...

  • @Jiovi
    @Jiovi Před rokem +1

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

  • @TriggerWarningStudios

    Excellent video

  • @gluckes
    @gluckes Před 9 měsíci +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.

  • @jasomega2446
    @jasomega2446 Před 10 měsíci +2

    6:42 Well said

  • @maddoxreuter7404
    @maddoxreuter7404 Před rokem

    you're the man!

  • @GabCom888
    @GabCom888 Před 3 měsíci

    You just won a subscriber

  • @Jrej_dev
    @Jrej_dev Před rokem

    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 Před 3 měsíci

    Adam C Younis is my best advice

  • @staticplays1871
    @staticplays1871 Před rokem +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 Před rokem +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.

  • @leenadhimte3099
    @leenadhimte3099 Před rokem

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

  • @omle8492
    @omle8492 Před rokem +2

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

  • @johngrey5806
    @johngrey5806 Před měsícem

    Liked, subscribed, and commented.

  • @DevlogBill
    @DevlogBill Před 10 měsíci

    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?

  • @videogamestutorial
    @videogamestutorial Před rokem

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

  • @pirateskeleton7828
    @pirateskeleton7828 Před rokem +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…

  • @ancientbeing9720
    @ancientbeing9720 Před 10 měsíci

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

  • @MusselPump1
    @MusselPump1 Před rokem +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

  • @amanammer
    @amanammer Před rokem +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  Před rokem +2

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

    • @amanammer
      @amanammer Před rokem

      @@ButWhyLevin will do! Thanks

  • @lightless
    @lightless Před rokem +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 😂

  • @massilyar341
    @massilyar341 Před 11 měsíci

    Can I use python on unity in some way

  • @jigarpanchal0
    @jigarpanchal0 Před rokem

    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

  • @JonHuhnMedical
    @JonHuhnMedical Před 10 měsíci

    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.

  • @a.medition2464
    @a.medition2464 Před 10 měsíci

    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 🥺

  • @kingofroms7224
    @kingofroms7224 Před rokem

    cool

  • @ashleyriot1805
    @ashleyriot1805 Před 4 měsíci +11

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

  • @Aidanryry
    @Aidanryry Před rokem

    BriefWhyLevin

  • @HLCaptain
    @HLCaptain Před rokem +1

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

  • @staticplays1871
    @staticplays1871 Před rokem

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

    • @ButWhyLevin
      @ButWhyLevin  Před rokem

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

    • @staticplays1871
      @staticplays1871 Před rokem

      @@ButWhyLevin ohhhhhhhhhhhhhhhhhhhhh. That makes more sense

    • @staticplays1871
      @staticplays1871 Před rokem

      @@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.

  • @general1983
    @general1983 Před rokem +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

  • @HoodedOlive
    @HoodedOlive Před rokem +5

    It’s pretty crazy that a university is sponsoring CZcams videos.

    • @RedCroissantGames
      @RedCroissantGames Před rokem +1

      He’s just that good

    • @HoodedOlive
      @HoodedOlive Před rokem

      @@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 Před rokem

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

    • @HoodedOlive
      @HoodedOlive Před rokem

      @@RedCroissantGames there are 50 states

    • @RedCroissantGames
      @RedCroissantGames Před rokem

      @@HoodedOlive south carolina isnt real

  • @troyna77
    @troyna77 Před 11 měsíci

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

  • @Joso997
    @Joso997 Před rokem +1

    One of my comments got removed 🤷‍♀

    • @humadi2001
      @humadi2001 Před rokem

      Is it because of his thumbnail😂

    • @Joso997
      @Joso997 Před rokem

      @@humadi2001 em no?

  • @rawkth5996
    @rawkth5996 Před rokem

    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.

  • @Project68K
    @Project68K Před rokem +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.

  • @rawkth5996
    @rawkth5996 Před rokem

    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.

  • @Greviouss
    @Greviouss Před 6 měsíci +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.

  • @joevaghn457
    @joevaghn457 Před rokem +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 Před rokem

      Some of us have never coded a bug dummy