How to make a 2D platformer - Unity Tutorial Crash Course

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

КОМЕНТАРІ • 587

  • @bblakeyyy
    @bblakeyyy  Рік тому +8

    I have a ton of scripts and assets related to this and my other tutorials that can help you out on my Patreon:
    www.patreon.com/BlakeyGames

    • @HyperCars_Vlog
      @HyperCars_Vlog 9 місяців тому

      How many levels this game have?

    • @Magic8112
      @Magic8112 5 місяців тому +1

      i cant make the player jump

    • @strelenykerik
      @strelenykerik Місяць тому

      @@Magic8112 me too

  • @orpheusyw
    @orpheusyw 3 роки тому +77

    Best tutorial I could find on Unity 2D Platformer! All other tutorial often go too fast or is using too many outside resources that is hard to follow. This one is just simple and perfect to get started! Thank you!

  • @eggabacon
    @eggabacon Рік тому +8

    I've tried so many times to make games using both Unity and Unreal Engine, but never did anything with it, however this video was very simple and useful, and I absolutely loved it. Thank you so much for making this.

  • @kibookamc
    @kibookamc 11 днів тому

    i like the fact that you explain what the code does, not just doing it. the other tutorials i see from other youtubers, are like just copy what i do even if you dont know what this does

  • @printerman9834
    @printerman9834 Рік тому +12

    Best tutorial I've found so far. No frills or pointless gabbing, just straight to the point, concise good information. Cheers mate

  • @Sw5pher
    @Sw5pher 2 роки тому +20

    WOW!! AMAZING!!!! This channel is TOO underrated, this was easy to understand and super simple to follow!

  • @Max-ko8fm
    @Max-ko8fm 2 роки тому +14

    Very good video! This is the best 2d platformer tutorial that I've found because most tutorials start with a tile-set which makes it hard to follow.

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

    I was so flipping happy when I did the movement script tears came, thank you so much 🙏

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

      Glad to hear that my friend!

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

    its been 5 years since i used unity this was the refresher as simple as it was i really needed it .Good jump !!

  • @MrRisko10
    @MrRisko10 2 роки тому +8

    Great Tutorial. One of the best tutorial I found. It’s not to fast or to slow. Just the correct speed.👍

  • @that_dude5431
    @that_dude5431 7 місяців тому +7

    The code to stop jumping mid air won't work

    • @bossofbarleybs
      @bossofbarleybs 6 місяців тому +1

      Ye i have the same problem

    • @VoidTentacion
      @VoidTentacion 2 місяці тому +1

      My problem is This Compiler Error thing. I have no idea Where that is

  • @molten621
    @molten621 Рік тому +2

    BRO! I have been looking around for a tutorial like this for AGES! thank you so much!

  • @GamingPlush64
    @GamingPlush64 2 роки тому +8

    There's a bit of a flaw in the way you coded your jumping. Whenever I'm against an object, even when there's no ground beneath it, I'm able to jump. Sometimes I hit an edge at such an angle that it disables my jump when I land, thinking that I'm still against it. Any idea how to fix that?

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

      try to give a extra space in your collision compared to the sprite

    • @DanielMTB663
      @DanielMTB663 4 місяці тому

      yeah i saw this but in a way i kind of like it

  • @Blinkers2007GameDev
    @Blinkers2007GameDev 2 роки тому +4

    Best tutorial on 2D plattformer imo. I will make my own 2D game eventually, thanks for your help.

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

      Glad to hear it dude!

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

      @@bblakeyyy thanks! I played your invisible platform game and loved it so much!!! But how does it save your progress? And how do I go back to menu?

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

      Thanks! That game was made around 3 years ago now, it was my first ever game, so doesn’t have a lot of the typical functionality a good game should.
      It saves ur progress by loading you into the level and saving the level ur in via an int :)

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

      @@bblakeyyy Great thanks

  • @fore4word_748
    @fore4word_748 2 роки тому +4

    Great video just finished half now and going going to finish it tomorrow

  • @CrnHans
    @CrnHans 5 місяців тому

    i have watched dozens of videos, to ensure that i am able to find the proper videos to help me. and yous are perfect. you deserve much more.

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

    This video makes all the concepts so much easier even a year later. Keep it up! 👍

  • @Tubethevibe
    @Tubethevibe 7 місяців тому

    Love your tutorials dude. Thank you so much for all the help and keep up the amazing work!

  • @vinhdev6803
    @vinhdev6803 2 роки тому +15

    I am using the new unity version and I think you will need to set Rigidbody2D in PlayerMovement script to public 'cause set it to private will make Rigidbody2D cannot work

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

      Ty bro I wondered why speed didn’t show up even though it was public😅

    • @raviensermo3103
      @raviensermo3103 9 місяців тому

      ur a legend with me it didnt work but thank you smh

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

    I thought that brackeys is the best tutorial to watch but after 2 minutes I didn't know what's going on... but you just keep it very simple and you explain everything very well keep it up. I'm going On the next tutorial so bye 👋

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

    Great tutorial! Watched until the end and everything worked. I am new to C# but you explained the code very well. Keep it up, homie.

  • @kibookamc
    @kibookamc 11 днів тому

    if you dont want to jump iwht space but instead vertical, just but in the quoations "Vertical"
    then go to edit -> project settings -> input manager -> axes -> vertical , then make sure there is nothing in the negative and alt negative

  • @keetee-ei3er
    @keetee-ei3er Рік тому +1

    Basically just hit the keys and hit the head to the wall until something happens on the screen and repeat the same over and over again. Just be patient with yourself, try different methods of learning etc. After watching tutorials try to build something using the concept you just learned, seek help and reminders after you stuck a dead end, try by yourself first. Slow by slow kick the bar higher and repeat the same learning process. Try to learn the logic behind the code concepts, but for sure you don't have to know everything. Eventually you will learn something. Building small projects again and again and then adding always some new and difficult to the project

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

      Good advice!

    • @keetee-ei3er
      @keetee-ei3er Рік тому +1

      @@bblakeyyy Thanks for your help! By the way, background music did not get unnoticed, great and relaxing atmosphere 🎼

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

    this is the most helpful video that i've watched for unity. great explanations thank you!

  • @Lou2a.a
    @Lou2a.a 2 роки тому

    amazing channel! i cant believe this quality only has 2k subs definitely subbed

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

    I have been trying to figure out player controls forever now thank you so much!

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

    Thank You! It was my first time I started to make the games and you really helped me to get in! God bless you, bro!

  • @pureegaming1604
    @pureegaming1604 7 місяців тому

    This and GMKT are the best Unity Tuts on UA-cam frfr

  • @vegasdealer777
    @vegasdealer777 5 місяців тому

    Excellent video! Simple enough to understand, but not TOO simple. Thanks.

  • @edwinlynch9326
    @edwinlynch9326 7 місяців тому

    Brilliant. A whole, simple game. All I need to do now is swap out for sprites and duplicate assets everywhere. Thank ewe Bblakeyyy

  • @IBeToxic
    @IBeToxic 3 місяці тому

    Thank you for this tutorial itll help me learn the basics of unity I'm going to try and make other games with the code that I learned and further improve my coding skills

  • @dootpooter4740
    @dootpooter4740 Рік тому +2

    This video was so good I'd buy you a free cup of coffee at the Jiffy Lube waiting room.

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

      That is so randomly specific

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

      This did also leave me baffled but appreciated nonetheless

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

    I set my speed to private and didn't declare it I just assigned it there and then. I prefer it that way. Works great if anyone else wants to use it 'private float speed = 10f;'

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

    Thank you for this tutorial, Blakey, you really helped me out here. It was straight to the point and clear so I could copy everything neatly. You are a lifesaver.

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

      You spell it bblakeyyy

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

      It’s alright, I actually go by Blakey on discord and stuff so works out :)

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

      @@bblakeyyy ok

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

    underrated channel +1 like

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

    Deserves a sub with all notifications best one out of the 13 tutorial video and easy!
    Edit:I did not expect to get a heart but thank you:)

  • @Just.A.Opinon
    @Just.A.Opinon 3 місяці тому

    this was a amazing tutorial it is my first game and since you explained the code good. i can now do some stuff on my own, Thank you!

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

    So Clear, Useful, Easy to learn and advanced at the same time
    All the thanks to you^^

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

    At 15:53 in the video, my recommendation is to not change “collision” to “other” as when I changed it to “other” my jumping did not perform correctly. But keeping it as “collision” made it work perfectly

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

      Your issue was most likely elsewhere, changing to other should not cause issues

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

    Legend! Simple and straightforward, with good explanations!

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

      glad to hear it! subscribe to the second channel for more tutorials!

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

    You explicated the code really good and like @Orpheus YW said the other tutorials of how to make a platformer on unity2D uses other sources or they are just simply not finished
    definitely subscribing

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

    This was an amazing and extremely helpful video, thank you and keep up the good work

  • @IM-ws5if
    @IM-ws5if 2 роки тому +1

    My first time i make a game in unity thanks bro

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

    hello to if your rigidbody and your monobehaviour arent working youve got to go to edit in the editor>prefrences>External tools and then set external script editor to the current code program your using in my case VS(Visual Studio)

  • @HookedWithEJ
    @HookedWithEJ 4 місяці тому

    THANK YOU SO MUCH! THIS TUTORIAL IS SUPER EASY!!! I CAN FINALLY MAKE 2D GAMES!

  • @CardHeroes
    @CardHeroes 9 місяців тому

    using for 2d animation but this has been a livesaver thank you!

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

    I finished ! it's a very good tutorial Thank you !

  • @CrashFranks-y9d
    @CrashFranks-y9d Рік тому

    you got a new subscriber very clear and beginner friendly

  • @bblakeyyy
    @bblakeyyy  2 роки тому +29

    Hey! I have a tutorial channel dedicated to just tutorials now! It can be found on my featured channels list!

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

      Hi I used this tutorial and when I implemented the movement part it gave me a syntax error and wouldn't show up in components tried one I found on stack over flow and didn't work either can you help? btw I was using unity 2020.3.

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

      @@notmelloyello Mind providing the script? Copy and paste it here

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

      9:45

    • @4ndrito
      @4ndrito Рік тому

      how do i add double jumping

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

    OMg this is amazing tutorial, please upload more tutorial i really learned new things but i am having some issue

  • @pietblubbervis
    @pietblubbervis 2 роки тому +4

    It doesn’t let me grab the rigidbody2D.. can someone help? I don’t know what I did wrong. I’m using vs2022 btw

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

    Amazing, simple and well explained.

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

    The best video ever , thanks 😃

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

    Very friendly to mobile viewers. Good and fast tutorial to start create your first platformer game.

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

      Friendly to PC viewers too! Really simple to follow, and I'm watching this on a computer!

  • @kylemorely1812
    @kylemorely1812 Рік тому +2

    There's a bug in this game" if you add a wall with a collider and everything, if you hold the AD keys when touching it, your character will stick to the wall.

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

    Thanks for the tutorial! Your tutorial helped a lot.

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

    fist game ive made I wasn’t able to figure out the pause menue bc my buttons just wont work but thats fine. I had so many probloms with coding that took me hours to figure out but finally did it. geat tut !

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

    Thanks, I found this very good. Not simple, but that’s not your fault. It was the computer.

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

    WTF THANK YOU THANK YOU THANK YOU!!!! I WAS LOOKING FOR A SUCH A GOOD VIDEO LIKE THIS AND I FOUND IT!! YOU HELPED ME SO MUCH!!!! Edit: at the void command lines I stuck bc this shows error here (help)

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

    22:37 BIG REMINDER to be mindful of how you're naming things! I was scratching my head why the "End" didn't load Scene2/level2 on collision. Welp! Named the Scene "Level 2", and upon putting the code, I put "Level2", sooo that space had me running loops for a good 3 minutes lol. I always forget how literal, word-by-word scripting/coding is...

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

    Best tutorial out there !

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

    Finally, a good tutorial.

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

    Great tutorial! Thank you!

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

    Thanks for the tutorial! I enjoyed it.

  • @HistoryandScience-o7p
    @HistoryandScience-o7p Рік тому +3

    i copied the code for moving but it don't work

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

      You also have to adjust the things and stuff

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

    ty 4 the tutorial, very informative

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

    You deserve a sub i made my own it it was perfect thank you very much i even made my own character and a floor

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

    Every legend started here... o7 o7 o7

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

    Thank you Man! continue with your dream ;)

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

    Deserves more views 100%

  • @danelotermin3178
    @danelotermin3178 Рік тому +2

    Hi loved the tutorial. Helped me a lot and maked me take my first steps. But, thee movement and jumping scriptt didn't work to me. Do you know a script for only jumping? I would really apriciate it. Thanks for all!!!

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

    Just loved it. Was fun.

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

    wonderful tutorial

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

    God this was so helpful, thanks a million

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

    Great Tutorial♥

  • @der-gus
    @der-gus 3 роки тому +2

    Thanks, I learned a lot

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

    Yes I fixed my problem. Anyway thank you for this great tutorial

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

    Great tutorial!

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

    How to make smooth camera movement:
    public GameObject target;
    public int smoothing;
    void Update()
    {
    float x_diff = (target.transform.position.x - transform.position.x) / smoothing;
    float y_diff = (target.transform.position.y - transform.position.y) / smoothing;
    transform.position += new Vector3(x_diff, y_diff, -10);
    }
    feel free to copy

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

    Great vid mann

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

    the best tutorial ever!!!! thank you.

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

    Amazing! Still works in 2022 in current version!
    One question though, How would I add more levels? When I try to use a duplicate of the script with level 3 instead of 2 it tells me that the original script also uses that code with the same parameters so the duplicate cant be used, meaning I can only have 2 levels. Would it be possible to make it so the script says:
    if(scene == level2)
    {
    SceneManager.LoadScene("Level3);
    }
    I know the if statement is incorrect but is there a way around this?
    Also the public void quit and resume doesnt work because in the newer versions it doesnt clasify that as a click. You can close the menu by pressing escape again though

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

      Glad to hear!

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

      @@bblakeyyy Hey sorry just edited my comment do you have any idea on how to help with my problems?

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

      @@TrendyBanana you can use the same script, doesn’t need to be duplicated.
      You need to add a public string at the top of your script, and pass that string into the brackets of your LoadScene function
      Then in the Unity editor just type in the name of the scene you want to load into the string input field
      Regarding the buttons, that should still work, make sure to double check your code and that you’ve passed the functions into the button component

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

      @@bblakeyyy would that be public string and then the variable? And would I put that variable inside the parentheses in the scene loader sentance?

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

      Public string sceneName
      SceneManager.LoadScene(sceneName)

  • @raviensermo3103
    @raviensermo3103 9 місяців тому +1

    the jump doesn't work

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

    great video thanks man!

  • @redthecoin64
    @redthecoin64 4 місяці тому

    New sub tysm this helped a lot bro

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

    The variables didn't show up in the PlayerMovement Component..

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

    For anyone who can get the menu to work, but clicking the resume button does nothing, the text needs to be the child object of the button. Dont know why thats the case but i figured it out

  • @janhasak1637
    @janhasak1637 Рік тому +2

    i have problem with a code of basic movement it doesnt show me the speed please help :(

  • @VoidTentacion
    @VoidTentacion 2 місяці тому +2

    Microsoft Doesn't let me download Visual Studio so I have to go on a Third-Party Website to Download it
    Edit: Also I use an Older Version of Unity And have no idea Where Compiler Errors are.

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

    Nice Tutorial

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

    Great job you're making the engineers like me 😉

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

    ERROR :
    Assets\PlayerMovement.cs(43,18): error CS0111: Type 'PlayerMovement' already defines a member called 'OnCollisionEnter2D' with the same parameter types

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

    Thanks now i can make my first game

  • @ShamrockShinobi
    @ShamrockShinobi 8 місяців тому

    Everything works amazingly, even figured out what i was doing wrong with the buttons except that everything ABOVE resume selects resume, but if im anywhere below it highlights quit. Is there a way to make it to where the only place you can select is the actual buttons and not anywhere around them?

  • @stevboi4867
    @stevboi4867 2 роки тому +22

    the first script doesn't work for me, a lot of the text isn't highlighted

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

      Same for me did u solve the problem yet ?

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

      @@Chubzdoomer thank you

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

      @@Chubzdoomer You are a literal GOD my friend!!!!! Thank you from the bottom of my heart

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

      Its not working for me too

    • @greenercancube-or5wo
      @greenercancube-or5wo Рік тому +1

      Any one who’s sees this he was most likely using a different colour scheme so it may not be the same, and if the code doesn’t work check for capitals and semicolons and mistakes the smallest mistake can cause problems and the whole thing won’t run

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

    this was so helpful thank you! you should make one for sapphire

  • @MemesSpices
    @MemesSpices Місяць тому

    simply thanks.

  • @Jakey398
    @Jakey398 9 місяців тому +1

    For some reason, my duck (which is what I used as the sprite) will spin randomly (when it goes over a corner too far or something similar, it will rotate around and it is quite annoying if I'm honest)

    • @Jakey398
      @Jakey398 7 місяців тому

      @thinic1Just got to working on the game now, that fixed it, thanks for the help!

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

    really simple, but i learned lot of things

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

    I did the movement script EXACTLY how you did it, but there is no speed variable in the component.
    Please comment why.

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

      I can’t comment why if you’ve said you’ve done it exactly how I’ve done it yet it doesn’t work

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

      @@bblakeyyy oh damn...

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

      im having the same issue as well