How to make a Video Game in Unity - MOVEMENT (E03)

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ส.ค. 2024
  • In this video we learn to control our player!
    ● Download scripts, assets and project files for this course: devassets.com/a...
    ● Developer Forum: forum.brackeys....
    Difficulty of lesson: Novice.
    ····················································································
    This video is part of a mini-series on making your first game in Unity.
    ····················································································
    ► Join Discord: / discord
    ♥ Subscribe: bit.ly/1kMekJV
    ● Website: brackeys.com/
    ● Facebook: / brackeys
    ● Twitter: / brackeystweet
    ········································­­·······································­·­····
    ► All content by Brackeys is 100% free. I believe that education should be available for everyone. Any support is truly appreciated so I can keep on making the content free of charge.
    ········································­­·······································­·­····
    ♪ "Too Cool" Kevin MacLeod (incompetech.com)
    Licensed under Creative Commons: By Attribution 3.0 License
    creativecommons...
    ♪ Baby Plays Electro Games
    teknoaxe.com/cg...

ความคิดเห็น • 4.2K

  • @kindapeachy696
    @kindapeachy696 4 ปีที่แล้ว +666

    Hearing "so let's save this" and pausing it in time to write his code before he opens the unity window again should be considered an extreme sport

    • @karlembeast
      @karlembeast 4 ปีที่แล้ว +42

      I would add to your comment on "extreme sport" and go as far as to say. Typing at the same time he writes his code, without pausing the video, should be considered an "extreme sport".

    • @theboringprogrammer4444
      @theboringprogrammer4444 4 ปีที่แล้ว +21

      @@karlembeast Noob, I typed the code before he even spelled the word "Unity"

    • @thesodanerd3205
      @thesodanerd3205 4 ปีที่แล้ว +3

      The boring programmer Then what the French are you doing here? It sounds like you already knew the code before watching the video

    • @theboringprogrammer4444
      @theboringprogrammer4444 4 ปีที่แล้ว +11

      @@thesodanerd3205 I was sarcastic.

    • @medityle1170
      @medityle1170 4 ปีที่แล้ว +3

      Caleb Little somewhat of an r/whoosh

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

    This is literally the first time i've used unity and I already feel like I can make the next god of war game, these tutorials are so damn good

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

      Don't be silly. You can't make next God Of War game.
      Sony would sue you for using their title.

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

      @@intru3915 //not gonna lie they got us in thr first half

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

      sony will sue you

    • @danceswithmetroids162
      @danceswithmetroids162 4 ปีที่แล้ว +33

      @@daniellordyt Ok, but Undertale, Stardew Valley, Cave Story and MINECRAFT were all developed by one person.
      Telling somebody it takes a while or it's difficult to make a game by themselves is fine, but stop telling people they just "can't do something". That's not helpful.

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

      daniellord ok but shut up and let the person have their moment thanksbye

  • @vermillion8521
    @vermillion8521 4 ปีที่แล้ว +765

    I just visited Brackey's asset store, and I must say, all of those beautiful assets? for free? I am literally gobsmacked, I am also a blender user and those assets on his store could easily sell for 50-100 $ *easily*. and even the most expensive price you can choose is 20$? This man is a literal God, he deserves so much more recognition
    I literally cannot stress how kind this guy is, its unbelievable

    • @smart_idiot8204
      @smart_idiot8204 3 ปีที่แล้ว +15

      He sure is a man of culture

    • @ibrahem891
      @ibrahem891 3 ปีที่แล้ว +33

      he is providing it for free but sure it is better to donate and support his work if you can .

    • @devscetric7982
      @devscetric7982 3 ปีที่แล้ว +13

      @Carlos Basulto he isn't like that, he generally likes to help people out.

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

      I know i use blender too and there are asset stores with like a 40$ a month subscripition so this is super cool to find

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

      200th like

  • @vectozavr
    @vectozavr 3 ปีที่แล้ว +509

    Thanks a lot for your job! I am proud of that youTube platform has such a great professionals :0

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

      hey bro I need some help here's my code:
      using UnityEngine;
      public class PlayerMovement : MonoBehaviour
      {
      public Rigidbody rb;
      public float forwardForce = 2000f;
      // Update is called once per frame
      void FixedUpdate()
      {
      rb.AddForce(0, 0, forwardForce * Time.deltaTime);
      if (Input.Getkey("d"))
      rb.Addforce(500 * Time.deltaTime, 0, 0);
      }
      }
      The problem lies within the if statement
      it says that "Input does not contain a definition for Getkey"
      and that "Rigidbody does not contain a definition for addforce

    • @Ace-me3ig
      @Ace-me3ig 3 ปีที่แล้ว

      @@MalalisJyleErwinD i think you missed a step in ep 2 check again

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

      @@MalalisJyleErwinD using UnityEngine;
      public class PlayerMovement : MonoBehaviour
      {
      public Rigidbody rb;
      public float ForwardForce = 2000f;
      public float SidewaysForce = 500f;
      // Start is called before the first frame update
      void Start()
      {
      }
      // Update is called once per frame
      void FixedUpdate()
      {
      rb.AddForce(0, 0, ForwardForce * Time.deltaTime);
      if (Input.GetKey("d"))
      {
      rb.AddForce(SidewaysForce * Time.deltaTime, 0, 0);
      }
      if (Input.GetKey("a"))
      {
      rb.AddForce(-SidewaysForce * Time.deltaTime, 0, 0);
      }
      }
      }

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

      @@MalalisJyleErwinD you wrote Getkey instead of GetKey (its case sensitive)

    • @LucasBrouwers0511
      @LucasBrouwers0511 3 ปีที่แล้ว

      @@MalalisJyleErwinD just retype it

  • @generalwurstwasser4189
    @generalwurstwasser4189 4 ปีที่แล้ว +686

    Here for the people who wondered why there is an f behind the 2000:
    Both Unityscript and C# use "f" to indicate a float and "d" to indicate a double. The difference is that double is the default for C#, but float is the default for Unityscript. So if you use a decimal number but leave off the "f" or "d", then it will use the default for whatever language you're using.

    • @xord1946
      @xord1946 4 ปีที่แล้ว +12

      This needs more upvotes, thanks, so I guess it's better to always use them so you're never fucked up by your environment.

    • @s.sradon9782
      @s.sradon9782 4 ปีที่แล้ว +11

      ​@@xord1946 this, loading the entire game at once, unused libraries, tying the game's physics to the framerate et sic in infinitum are all things that yandere dev did before (and got pissed at people rewriting his code) honestly it's more fun to look at the effects these things had on the games than playing them, but it is the best way of showing how this affects your project so you'll never get fucked over by your own stupidity.
      all hail general sosigwater

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

      are you sure it doesn't want us to pay respec

    • @reallylegit5145
      @reallylegit5145 4 ปีที่แล้ว +3

      imagine leaving a comment on a video you didn't watch. 6:23

    • @generalwurstwasser4189
      @generalwurstwasser4189 4 ปีที่แล้ว +8

      @@reallylegit5145 He didn't really explain why the f is behind the number, he just said that unity complained. So maybe you should watch the video again.

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

    That feeling when you Go from wondering, "how the hell do you make things move in unity with code?" to actually making it happen :D feelsgoodman

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

      oh yeah

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

      so true!

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

      The best feeling!

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

      to that moment where you make a new game and have to come back to this vid bcs you forgot how to code moving

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

      Is started giggling like a toddler

  • @yisle2802
    @yisle2802 4 ปีที่แล้ว +57

    It's incredible how this amazing tutorials are way better than a whole semester at a university

  • @zaleshomeowner3493
    @zaleshomeowner3493 ปีที่แล้ว +16

    I know you're not making videos anymore, but I just wanted to say that you are a saint for uploading free to use assets and files for your series. You are a beautiful person.

    • @user-dz8pk3qv1n
      @user-dz8pk3qv1n 6 หลายเดือนก่อน

      Hii bro

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

      I know right. new to unity and its so helpful to get free assets just to test things with

  • @randomproductions3979
    @randomproductions3979 4 ปีที่แล้ว +1325

    Brackeys : talks about variables
    me with my 1 year of scratch experience : "I am four parallel universes ahead of you"

  • @_tommunist_
    @_tommunist_ 7 ปีที่แล้ว +531

    Is it just me, or has the quality of these videos become astounding?

    • @Brackeys
      @Brackeys  7 ปีที่แล้ว +61

      Wow, thanks a lot! Been putting a lot more time into each one :)

    • @_tommunist_
      @_tommunist_ 7 ปีที่แล้ว +3

      Brackeys no problem! I've been watching you for quite a long while!

    • @furyshiftz
      @furyshiftz 7 ปีที่แล้ว

      What Number If You Want To Do Backwards Force Please Reply Brackeys

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

      simple put, give it a negative number, if you are only asking for going backwards, it should work fine

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

      Its simple the direction of backwards is -z
      So do this (0,0,-BackwardSpeed)

  • @Sentoefn
    @Sentoefn 3 ปีที่แล้ว +516

    "Getkey" is used for if the key is held down while "getkeydown" is used for if the key is pressed once
    You're welcome

    • @jfuggjuy9447
      @jfuggjuy9447 3 ปีที่แล้ว +9

      thanks

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

      Sir, what should we write after the "GetKey" so that we can move our player by pressing the arrow keys present on our keyboard.
      Can u plz tell me!?

    • @Sentoefn
      @Sentoefn 3 ปีที่แล้ว +4

      @James Thwaites same thing i said just simplified

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

      ​@@Sentoefn life saver

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

      You’re*

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

    5 years later and this code still works

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

      it didnt for me though :C

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

      @@tamajthelegend4232 damn how come?

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

      Wait, it does not work?

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

      @@spartan112 it does for me but not for tama

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

      @@Icanthandle938 When I multiply it with Time.deltaTime, it does not work

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

    I learned more programming from this mini-series than in an entire year of studying computer science, good job man, your ways of teaching are ON POINT.

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

      There's something wrong with how you study computer science then

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

      @@ethanma1722 fr lmaoo

    • @mertb.297
      @mertb.297 5 ปีที่แล้ว +3

      U study in bangladesh or sth like that?

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

      I studied in khan academy programing...
      Didn't learn much

    • @whytry4682
      @whytry4682 4 ปีที่แล้ว

      Same

  • @wow-sg9mk
    @wow-sg9mk 5 ปีที่แล้ว +1243

    It's funny how every video has so many less views than the previous. Gotta stay motivated

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

      Basically every video series about anything ever (gameplay or teaching , both got same problem)

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

      Unfortunately we're in a time where it's about "I want it NOW" rather than learning, waiting or earning it. I think many people expected to make a game after 2 or 3 small tutorials and when they realized it takes more work, they gave up. Kinda sad, really.

    • @itssante5693
      @itssante5693 5 ปีที่แล้ว

      @@1NabbinatoR thx for the idea XD

    • @mohammedbenchama5275
      @mohammedbenchama5275 4 ปีที่แล้ว +3

      its too hard to continue

    • @Scarletraven87
      @Scarletraven87 4 ปีที่แล้ว +18

      Or maybe it is just because - as every tutorial on YT - it is casually and intentionally watched (and re-watched) many times over the course of years, so natually the older videos will have more views.

  • @frostinstant1892
    @frostinstant1892 3 ปีที่แล้ว +7

    I love how he gives us the basics and explains it really well, and then every other thing he explains in understanable

  • @thelightbringer8610
    @thelightbringer8610 ปีที่แล้ว +27

    This video is so cool!
    After you showed how to code for left/right movement, i wannted to try to get forward backwards and jumping on my own!
    it was so much fun to learn

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

      Same thing is happening to me

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

    I laughed every time I successfully coded the cube and watched it run away. Thanks for the awesome course.

    • @ragingraven0003
      @ragingraven0003 3 ปีที่แล้ว

      Same! I giggle and tell my fiance to come see every time I successfully code 😂😂

    • @Grant-np7jd
      @Grant-np7jd 3 ปีที่แล้ว

      sameeeee

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

      I showed it to my mom and she said that I am wasting my time... Pain.

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

      when i press "a" ,it doesn't move left, any help please!!

  • @bojken5384
    @bojken5384 7 ปีที่แล้ว +488

    Thanks Brackeys for making videos for us

    • @Brackeys
      @Brackeys  7 ปีที่แล้ว +24

      You are very welcome! :D

    • @armeenseyyedy9016
      @armeenseyyedy9016 7 ปีที่แล้ว +3

      Great tutorial mate, keep it up, thank you so much!

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

      Brackeys really nice videos. Would love to see how to make ropes like the once used in some platformers to swing from platform to platform.

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

    I was a computer engineering student 20 years ago... I never had so much fun accomplishing anything like today... thank you a lifetime...

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

    brackeys even though you have quit youtube you wont be forgotten you have helped countless people make games you have already gave people thousands apon thousands of dollars just because of your tutorials man good job dude

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

    He puts the " f " at the end of public float numbers to pay respecc

  • @sanderhoel6289
    @sanderhoel6289 7 ปีที่แล้ว +244

    I really like how you explain everything so that everyone understands

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

      I love your pro pic its so funny

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

      ha I still don't understand anything

    • @kintler11
      @kintler11 6 ปีที่แล้ว

      Helped me learn programming very well.

    • @boiplaying2647
      @boiplaying2647 5 ปีที่แล้ว

      @@mrebbesen You Should focus, its easy

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

    Dude out of all my years on youtube this is these videos are the ones i most enjoyed. Good job my guy

  • @_.emberrr
    @_.emberrr 3 ปีที่แล้ว +12

    I will always return to this as the videos that started my career.

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

      And? Did it work out?

    • @_.emberrr
      @_.emberrr 2 ปีที่แล้ว

      @@NoSp1ne ok when i said career i didnt mean i immediately started making money but what i meant is that this is what got me into coding. first in unity, then i went to console apps, WPF, etc. still a novice, though

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

    Coding your own games is easier than you think. You know, you should take this online Unity course.

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

      i can never tell if it says Udemy or Unity lmao

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

      @@mattboioioing same

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

      @@HHHHH-vm5kc just stick with youtube. Its better to research on your own than do what other people tells you to do.

    • @SUB-ye4qc
      @SUB-ye4qc 5 ปีที่แล้ว +1

      @CJH technicaly yes

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

      I got this ad 1,000 times lol

  • @CmFive
    @CmFive 4 ปีที่แล้ว +279

    Me, a year ago: "I'm going to watch this for fun!"
    Me, right now: "Wow, I finally have Unity installed! What should I make?"

    • @74gaara42
      @74gaara42 4 ปีที่แล้ว +6

      Help makeing timesplitters rewind :)

    • @emilegoulard265
      @emilegoulard265 4 ปีที่แล้ว +7

      U da man, Cat Man.
      Anyways I always wanted to get into Unity whilst I was in my GameMaker Phase and I had this similar feeling like you lol.

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

      Wow Same Man!

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

      Yooo same

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

      Add block and BEAN

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

    I am 12 years old and these tutorials help me so much , I do not understand completely whats going on but still I learnt a lot about C sharp and game development , thank you soo much for these free tutorials

  • @curiouSs-NA1
    @curiouSs-NA1 ปีที่แล้ว +2

    I love when youtubers make a important aspect to coding something related to real life.

  • @TimM-kz1vl
    @TimM-kz1vl 5 ปีที่แล้ว +44

    Thank you so much for making these videos! I started off as some dude who had all these ideas for games but no way to implement them. Every tutorial I found, had something missing and I'm not sure what. Being able to take the crappy 3d models I've been making and watching them move from my controls, showed me just how far I've come. To everyone else, I'd recommend taking notes on these vids so you don't have to keep rewatching them. Here's my notes so far: Unity Notes (Brackeys)
    Video 1/Intro
    Controls:
    Middle mouse to zoom.
    Hold alt to pan around and to use WASD.
    Scroll wheel to zoom in/out.
    F to focus.
    Rotate tools and everything, are top right or using QWERT.
    Rigidbody component to get the item to use the game’s physics.
    Box collider: stops item from colliding with other objects. Can set an object to collide like any item regardless of its mesh.
    Mesh is how you see it.
    Video 2 Programming
    // are comments that are ignored
    C# script edited in Visual Studio
    C# is case sensitive and end all lines with ;
    To add script: go to component and choose Add Script.
    Must drag script to item before it can be used.
    Void Start: Runs script when game starts and only once.
    Void Update: Runs script per frame
    Console notes: Debug.Log(“Message here”);
    Above function: public Rigidbody rb; (Defines Rigidbody as rb so we don’t have to keep typing it.)
    On the inspector tab, anything with that script applied to it, will now have an extra slot in their script where you drag the rigid body component to. So when you write any code referencing rb, it knows you mean Rigidbody.
    Under void start:
    rb.useGravity = false;
    Replace rb.useGravity = false; with rb.AddForce( 0, 200, 500); // x, y, z
    Erase entire start function then,
    Under void Update:
    rb.AddForce( 0, 0, 200);
    But how much force you get, depends on your frames which differs from computer to computer.
    Add in rb.AddForce( 0, 0, 200 * Time.deltaTime);
    Force wasn’t strong enough so change the 200 to 2000
    Change void update to FixedUpdate
    Boolean is (if-then) statements.
    Video 3: movement
    Freeze Constraints/rotation under Rigidbody
    Using physics material (Create>physics material)
    To edit a value without going into the code, we use variables:
    To make it editable, we type Public before the line.
    Example: public int. Health = 10; //This tells the game that health is both an integer, a variable and is equal to ten.
    I can then edit Health = 5; // or w/e I want, later on.
    Debug.Log(Health); // displays health in console
    Next example:
    First do Public float forwardForce = 2000
    Using Public makes a variable editable
    After that, you must go down to the rb.AddForce( 0, 0, 200 * Time.deltaTime); and change it to rb.AddForce(0, 0, forwardForce * Time.deltaTime); //Now the game knows that the forward force it’s exerting, is equal to the variable you edit in the inspector.
    Player controls/if-then statements
    != (not equal to
    if (Input.GetKey("d") )
    //Only executed if condition is met
    rb.AddForce(500 * Time.deltaTime, 0, 0); //This is your "Then" statement
    X axis is right and left, so -500 is right, 500 is left
    Sometimes Unity will complain if a float number is not followed by an f, like 2000f

    • @mohammedaljassim5828
      @mohammedaljassim5828 4 ปีที่แล้ว

      :O

    • @karlembeast
      @karlembeast 4 ปีที่แล้ว

      Would be amazing if someone could type this up in LaTeX! 👌😂

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

      what do you do in your free time lol

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

      Thank u good sir for the notes! 😊👍

    • @arishakhan1137
      @arishakhan1137 4 ปีที่แล้ว

      Thank you!

  • @stef9019
    @stef9019 7 ปีที่แล้ว +45

    You're such a great guy for having a free option for everything.... that's rare y'know. Because you made it free i'm going to pay for it in the future :D I love your videos!

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

    I’m new to these things but the fact that they made their assets depends on your option, if you want to pay or not, is a very generous act by them!! Nice guys you’re the best for real🙏

  • @Michael-sc8if
    @Michael-sc8if 3 ปีที่แล้ว +21

    I was able to do this tutorial without one error! Yahoo! I think I will have to invest in an additional monitor, switching from Unity to TH-cam to Visual Studio is time-consuming.

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

      i feel you hahaha

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

      I open TH-cam in my tab

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

      bruh your alt tab game is WEAK

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

    Finally a video that explains what variables are in a concise manner. Not even my old teachers knew how to explain variables the way you did.

  • @xanny57
    @xanny57 7 ปีที่แล้ว +76

    Here are some requested topic which I'd like to see:
    -Collision checking
    -Health variables with particle effect on death
    And as always: This video was absolutely great! :D

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

      if you need help with collision i can help

    • @xanny57
      @xanny57 7 ปีที่แล้ว

      That's very nice!
      I'm just new in coding in C# and barely know what a variable is...
      Just kidding :D
      But still I'm very bad at coding but if you could help me with collision-checking (only a technique, maybe), that would be awesome! :D

    • @ImTornadoify
      @ImTornadoify 7 ปีที่แล้ว

      Just use this function: void OnCollision*x*(Collision col)
      'x' could be "Enter", "Stay", "Exit".
      Just make sure you add a Collider to the GameObject and a Rigidbody if necessary.
      Here's an example of the function:
      public void OnCollisionEnter(Collision col)
      {
      Debug.Log("Something Collided with me!");
      }

    • @maxofcourse
      @maxofcourse 7 ปีที่แล้ว

      if you want stuff with particle effect on death, Brackeys has a video in his Multiplayer FPS series that shows death and spawn effects :D

    • @xanny57
      @xanny57 7 ปีที่แล้ว

      Tornado Thanks for the reply, but I have another question: What is "void"?
      I know the meaning as a word, but in programming, how could you describe it?
      I just don't get it :/

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

    I'm headed to your patreon now. This is the absolute BEST, most helpful tutorial I have gone through. I've wasted so much money on courses all over the web and none of them are this great. Thank you so much

  • @nightcrow578
    @nightcrow578 10 หลายเดือนก่อน +1

    this guy is very kind for making a site where you can download his own made textures and more for free for those who dosen't have any money to afford. this guy is totally sent by god to earth

  • @hjc1710
    @hjc1710 4 ปีที่แล้ว +11

    Just wanted to call out, you're a great teacher dude, you really are. I've known programming for years, but your approach to teaching vars and everything is spot on.
    Seriously great work!

  • @user-mj8xn4ho3h
    @user-mj8xn4ho3h 5 ปีที่แล้ว +35

    you are a living LEGEND! you make all of this for free and really easy to follow and understand thank man I love your vids!!!

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

    trying to start making games
    and you are my savior, you deserve a sub
    and the free assets just makes this situation 100 times better
    youre a legend

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

    I've been looking for some coding tutorials for Unity cuz I kinda wanted to be a game dev and everything was so hard but... when I saw this vid called how to program, I started my own program and this started my life as a game dev. A couple of months passed and then I saw this vid called "GoodBye Thank you for everything!" he stopped uploading. and I was kinda sad but happy for Brackeys. Hope he gets his free life. He will be my inspiration forever:).

  • @xxzippyzachxx
    @xxzippyzachxx 7 ปีที่แล้ว +52

    Wow! I don't think there is anyone better on TH-cam that explains Unity like you! Great job!!!

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

    This man is such lawful good energy and it makes me have faith in humanity. Making ur products a pay what u can afford. You and elon musk man, you too are here to make the world better ILY

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

    im 13 and had started coding this year man and this is the first really good coding lesson after 2 years of surfing the wed

  • @ramtourgeman
    @ramtourgeman 7 ปีที่แล้ว +20

    I'm so happy you made this tutorial when.
    I tried to get into Unity I had badtime to figure out a tutorial to know the basics of Unity.
    I like your content keep with it Brackeys!

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

    The sheer quality of these free videos on youtube is insane! You honestly deserve to be one of those pro teachers for $300 courses on udemy for just how approachable your videos are! Thanks so much from me and I'm guessing the literal millions of people you've helped

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

    for those who want to optimize it using the method brackeys said during the end of the vid, here is the code to do it:
    private bool dKey = false;
    private bool aKey = false;
    private void Update()
    {
    if (Input.GetKey("d"))
    {
    dKey = true;
    }
    else dKey = false;
    if (Input.GetKey("a"))
    {
    aKey = true;
    }
    else aKey = false;
    }
    void FixedUpdate()
    {
    rigidbody.AddForce(xForce, yForce, zForce * Time.deltaTime);
    if (dKey)
    {
    rigidbody.AddForce(movementSpeed * Time.deltaTime, 0, 0);
    }
    if(aKey)
    {
    rigidbody.AddForce(-movementSpeed * Time.deltaTime, 0, 0);
    }
    }

    • @Gabriel-zy6xv
      @Gabriel-zy6xv ปีที่แล้ว +7

      would you not have the else if(aKey) as an if statement? that way when you hold down both at the same time it doesnt just think you're only applying the force of holding down the d key

    • @gupta.s
      @gupta.s ปีที่แล้ว

      Thanks for copying the code here, now I don't have to search outside to look for how to do it properly.

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

      @@Gabriel-zy6xv lol sorry for the late af reply, yeah ur right, I changed it

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

      THANK YOU SO MUCH

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

      Thank you so much

  • @shomen96
    @shomen96 3 ปีที่แล้ว +78

    “You can pay whatever you like for this”
    That’s how you get subs without asking 😘

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

    if your watching this tutorial and feel like giving up trust me don't, you'll get there eventually and once you do you will be glad u didn't stop.

  • @kyptix225
    @kyptix225 4 ปีที่แล้ว +54

    Wow, a udemy ad on this free turtorial.

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

      i saw that as well lol

    • @aaronfidelis3188
      @aaronfidelis3188 4 ปีที่แล้ว

      Just despicable...

    • @joshawafrith4797
      @joshawafrith4797 3 ปีที่แล้ว

      @@aaronfidelis3188 yeah how despicable. guy gives free lessons, free assets and has the audacity to have ads on his videos, shame on him for getting TH-cam to fund his time and effort.

    • @chronofactor2037
      @chronofactor2037 3 ปีที่แล้ว

      @@joshawafrith4797 That isn't what he meant, he meant that Udemy is bad for trying to take views away from him by advertizing their courses. It's not a problem of there being monetization on the video.

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

    crazy to think hes been gone for a year and im still watching his videos, i love you brackeys your tutorials are still helping me to this day

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

      bruh dev assets is down, so sadgee

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

    So I really just started coding a short time ago, and it's quite a challenge to begin learning. I actually started a college coding class in high school to learn because my school doesn't provide how to code. In the class I have been struggling and often felt unable to write what I deemed important down because the classes are online, so they more or less went over my head about a week and a half in. I picked up the first couple of these videos but I lacked motivation to keep at it, but after the puzzling of my recent classes I figured this might help familiarize me. In this episode you have motivated me past daydreaming game ideas and I am now taking notes on your videos. Thanks.

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

    As a player(and a somewhat curious programmer), I finally knew what's happening behind when I'm missing those inputs in low framerates. Thanks for the great tutorials.

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

    This man is a fucking legend, thank you for taking time to do this. You're too good for humanity!!!

  • @paulmarshall802
    @paulmarshall802 4 ปีที่แล้ว +8

    Thanks for these tutorials! I'm getting back into basic game making after 12 years or so, and this is very helpful.
    I couldn't get the A and D to work, but I did not give up. Unity has a new input system since this video, and to get it to work I followed this:
    You can find the corresponding setting in the Player settings (menu: Edit > Project Settings > Player), under Active Input Handling. You can change this setting at any time. Doing so will restart the Editor.
    Note: You can enable both the old and the new system at the same time. To do so, set Active Input Handling to Both.

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

      it's still not responding any help?

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

      I was struggling for 30 minutes thinking this tutorial was outdated because my code wouldn't work. This comment helped a lot.

  • @LV-sl5ql
    @LV-sl5ql 2 ปีที่แล้ว +2

    I already know that you are no longer uploading in this channel. Just putting a random comment here to remind you that in everyday you are still helping someone to become a great gameDeveloper. Thanks!

  • @michaeln.pierce3728
    @michaeln.pierce3728 4 ปีที่แล้ว +5

    It's such a terrible feeling to get stuck with errors in the codes and no idea what to do, but such a great feeling when you finally figure it out and fix it.

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

    I’ve been trying to figure out how to make video games for my entire life, it has always been my passion, and finding these tutorials was a blessing, so thanks!! I just downloaded unity (again lol) and im gonna put alot of work into this. Thanks for keeping this entertaining!

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

    THANK YOU SO MUCH FOR MAKING A FREE DEV WEBSITE I DONT HAVE A LOT OF MONEY BUT I WILL MAKE SURE TO SUPPORT YOU WHEN I CAN!

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

    Brackey's is a legend becoz he teach us better than paid courses

  • @DTvoyager
    @DTvoyager 4 ปีที่แล้ว +3

    "And it already starts to feel like a game" YESSSS! As a visual artist this made so much sense to me than the Console printing method.

  • @jdam9520
    @jdam9520 7 ปีที่แล้ว +111

    The best tutorial ever, even my grandmom can understend it.

  • @AstonArchitecture
    @AstonArchitecture 3 ปีที่แล้ว

    Fantastic, of all the tutorials I've seen these last few days, you are the only person to explain why "f" is used in float values.

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

    I bought a course one of the top courses in udemy and it was nothing comparing to your videos, REALLY GREAT JOB MAN

  • @charKT-7461
    @charKT-7461 6 ปีที่แล้ว +41

    Online Courses on Udemy: ✋😤
    Brackeys’ Tutorials: 😀👌

  • @JohnSmith-vf2xy
    @JohnSmith-vf2xy 7 ปีที่แล้ว +3

    209 likes and no dislikes? Wow, you make really nice content.
    This is a really helpful channel, definitely subscribing and liking.

  • @Seth-ug7ol
    @Seth-ug7ol 2 ปีที่แล้ว +1

    Dude these tutorials are 10/10

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

    Brackeys! Thank you so much for creating that asset repository! I'm working on learning unity and gamedev, and some of your fantasy assets will make excellent placeholders while I learn modeling! I cannot thank you enough for this service you are providing!!

  • @noname_panda2836
    @noname_panda2836 4 ปีที่แล้ว +112

    "he starts rotating and jumping"
    Me using a sphere: I am four parrarel universes ahead of you!

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

      Sorry but not very funny.
      Please don't call me a boomer

    • @destinysunny3675
      @destinysunny3675 4 ปีที่แล้ว +8

      This is really funny... I did the same, and it was really fine without adding physic material

    • @BananaWasTaken
      @BananaWasTaken 3 ปีที่แล้ว +4

      @@bbgamingplay1511 you’re not a boomer, just kinda dumb. Why bother replying just to say ‘not funny’ and add nothing of value to the replys. We do not need to hear your personal opinion. At least if you call it funny then the original commenter gets to know their comment had a positive impact. Now I’m not saying ‘if you don’t have anything nice to say don’t say it’, feel free to express your opinion, but at least do it in the form of constructive criticism instead of just a negative comment (e.g ‘I do not find this very funny because.......’ then you could explain why you don’t find it funny (whether it’s just not your sense of humour, not very original, etc)).

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

    Hey man, just want to express my deepest gratitude, for your AMAZING efforts with teaching an expansive topic, in such a fairly simplistic manner. Just pushing until I become more financially stable, then I'd LOVE to support you via Patreon 🔥
    Love what you're doing & implore for you to keep going 🙏
    - GamerTank

  • @ohmbasa
    @ohmbasa 6 หลายเดือนก่อน

    This is so helpful. I have no prior experience with any of this and I'm learning easily

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

    I personally have more experience in python, seeing how that's mainly the code my school offers, But coming from python to c# felt overwhelming and this video has honestly shown me how alike the 2 different coding types are

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

    Man these tutorials are incredible I really feel like i'm learning something from them 10/10

  • @neelamverma1032
    @neelamverma1032 4 ปีที่แล้ว +30

    Unity- 1-Brackeys
    2- Sykoo
    Blender- 1-Andrew(Blender guru)
    2- CG Geek
    How many agree with me?

    • @SunilNmb
      @SunilNmb 4 ปีที่แล้ว

      G develop-wishforge games

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

      @@SunilNmb i never heard about this channel

    • @shreyanshsingh1814
      @shreyanshsingh1814 3 ปีที่แล้ว

      but with funny game dev vdos dani is the #1

  • @gabrielvarca
    @gabrielvarca 3 ปีที่แล้ว

    2 days into your TH-cam course, God Thank you so so much

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

    My, my! Heis answering all my questions as soon as they pop up!

  • @GameOver7853
    @GameOver7853 7 ปีที่แล้ว +19

    The best Unity tutor of all time

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

    This went perfectly well!

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

    this guy teaches so fast that every second is full of detail which i literally love it 😍😍

  • @fafe1234
    @fafe1234 7 ปีที่แล้ว +4

    Brackeys keep making videos they're awesome what I like about you is that you explain well and you don't just give us the code keep it up!!😄😄

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

    I actually did something, after I finished the video I went back into the code and programmed a way to move forward with a button input and move backwards with a button input as well. It's small but its something I did myself.

    • @fortis7881
      @fortis7881 3 ปีที่แล้ว

      Did the same when my brother challenged me to do so, I also (sort of) gave the cube the ability to fly when I was just trying to make it jump. It felt so cool and satisfying.

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

      me too..😁...also added a break (or backward movement)...felling proud😎

    • @Johnny-gr7fy
      @Johnny-gr7fy 2 ปีที่แล้ว

      @@TrojanWF don't know why the input command doesn't work and gives an error on the console?

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

      @@Johnny-gr7fy had u checked capital and other syntax relation too ?? Cuz sometimes a small problem for exame writing small a instead of capital a can throw error
      Edit:- if u r still stuck I advise u to join brackey discord... u can easily ask question in #unity channel....they r very helpful (in my case atleast)

  • @cerealbawxtv
    @cerealbawxtv 3 ปีที่แล้ว

    I'm finding this over 4 years after it's been uploaded and it's still been very very very helpful. Just got yourself a new sub!

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

    This tutorial series is amazing. Ive been studying programing for over a year so I understand for example how variables work but its done so well that I dont get bored. He manages to find a balance of explaining very relatably while keeping a nice tempo. Its not so slow that you get bored but also not so quick its like a Sebastian League video

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

    thank to the youtube gods that we can watch videos at x.75

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

      Shreerang Vaidya I played this at 0x Thank the TH-cam gods

    • @ItsMeAndru
      @ItsMeAndru 5 ปีที่แล้ว

      Well, thank you as well for that info.

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

      10nk u, I ddnt know, from now i'll watch tutorials on x1.25 or more.

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

      Thank this god called Brackeys!

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

    for the input just have a global float variable called "xInput" or something and then update that value with "xInput = Input.GetAxis("Horizontal")"
    That value is being smoothed by unity itself (I did a Debug.Log() of it and it doesn't just snap to -1, 0 or 1, but creeps up on it).
    Also i think it works for controllers.

    • @KaranKhirsariya
      @KaranKhirsariya 4 ปีที่แล้ว

      Adding to that, if we want to only use -1,0,1 and not need the variables in between we can always use xInput = Input.getAxisRaw("Horizontal")

  • @danielf5651
    @danielf5651 4 ปีที่แล้ว

    Watching your tutorials in 2020 and it's awesome.

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

    I wish unreal tutorials was as clear and well taught as this thankyou mate

  • @YodaForce157
    @YodaForce157 4 ปีที่แล้ว +35

    It wont work for me ive got the error “the variable rb of playerMovement has not been assigned
    Edit:i put none (rigidbody) to player (rigidbody”

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

      Yea I had the same problem this fixed it though thx !

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

      what do you mean

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

      Hi I am still a little Can fuzed can you please explain a little more

    • @justadogwithagun6230
      @justadogwithagun6230 3 ปีที่แล้ว

      @@hunniedew5037 add the component rigidbody to the script like he does

    • @user-kq3xn3jp7m
      @user-kq3xn3jp7m 3 ปีที่แล้ว

      I dont get the mistake u made, can u clarify?? im getting the same error

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

    I always get anxiety when the coding starts but you are such a great teacher you explain all the stuff i had issues with. thank you

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

      haha same, i get scared but then its really simple concepts that he makes even more easy to understand. its usually a pain for me but it feels fun when doing it for a game :)

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

    I greatly appreciate the time you put into these tutorials. They are helping me out a lot for a series made 5 years ago. :)

  • @atharvp.42
    @atharvp.42 3 ปีที่แล้ว +1

    IT WORKED!!!!!!!! TYSM, I WAS STRUGGLING WITH VS CODE AND IT WAS NOT WORKING AND NOW WHEN I MANUALLY DOWNLOADED EVERYTHING ANDE SETUP IT (WHICH TOOK ME 2 DAYS) AND NOW FINNALY IT IS MOVING. THANK YOUUUU!!!!

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

    02:50 it's also in python!! and thanks for a 10/10 tutorial

  • @xanny57
    @xanny57 7 ปีที่แล้ว +13

    Third😅
    Really good video!
    Waited so long for this!😁

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

    This is fantastic man. Thank you for doing this. We really are living in the golden age of learning.

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

    It takes a master to explain complex topics and make it easy to understand. Thanks for the vids

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

    For what he said about doing the input checking within the update, I created a decent approach I think.
    Under the forward and sidewaysForce variables, I created two new bool variables: moveLeft and moveRight.
    I then created an update method above the FixedUpdate that goes like this:
    moveLeft = false;
    moveRight = false;

    if (Input.GetKey("d"))
    {
    moveRight = true;
    }

    if (Input.GetKey("a"))
    {
    moveLeft = true;
    }
    I then replaced the Input.GetKey() instances in the FixedUpdate with comparisons to see if moveLeft and moveRight are true.
    Feel free to use yourself!

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

      Hey i need help my a key dosent work i tried ur code it kept saying error

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

    Im having so much fun with just the cube movement

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

    5 years later, this tutorial is still helpful!

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

    I loved that you added the extra challenge at the end! I managed it myself :)

  • @z-1227
    @z-1227 5 ปีที่แล้ว +3

    Awesome I like that you let people choose a price I think that's really cool because not everyone can pay.

  • @benceszke7209
    @benceszke7209 4 ปีที่แล้ว +3

    Holy cow! Tanks dude! This makes my life soo much easier, Even with Java experience this is understandable