Secrets to a Great Platformer Character with Unity

Поделиться
HTML-код
  • Опубликовано: 19 июн 2024
  • Platformers are defined by their movement. Whether it be the momentum-based thrills of Super Meat Boy or the elegant combat of Hollow Knight. As a result, I want to share my approach to Platformer Movement (with the help of Unity 2D) and how you can apply it to improve your own games.
    👩‍💻Code: github.com/Dawnosaur/platform...
    🎮Demo: dawnosaur.itch.io/platformer-...
    💬Discord: / discord
    🦚Twitter: / dawnosaurdev
    📚Here's some further reading that I've found super interesting:
    ◽ Article on Jump Design: www.davetech.co.uk/gamedevplat...
    ◽ GMTK Platformer Research: / 28582857
    ◽ Article on Sonic's Movement info.sonicretro.org/SPG:Charac...
    ⏰Time Stamps:
    0:00 Why great movement is crucial for a Platformer?
    0:13 What are the core parts of your character's movement?
    0:22 How do most people approach movement?
    0:43 My approach to platformer movement
    1:04 What can we do with this approach?
    1:25 Platformer Design of Hollow Knight
    1:52 Building on this approach to movement with Celeste
    2:20 More ideas to enhance your game's feel
    2:29 Platformer Design of Super Meat Boy
    2:51 What else will we need to do to create a Great Platformer Character?
  • ИгрыИгры

Комментарии • 98

  • @robertsonnortey4140
    @robertsonnortey4140 Год назад +59

    While other youtubers are asking for a fee for their 2D character controllers, you actually made yours accessible for everyone to try out and i must say i really respect that a lot and appreciate the time and effort to help developers out there in need of stuff like these. To even make things better, your code is very clean and readable and commented.. thanks so much.. you just earned yourself a subscriber and a stan. Keep up the good work!!

    • @DawnosaurDev
      @DawnosaurDev  Год назад +6

      wow thanks so much, that means a lot!

  • @Chemtekmain
    @Chemtekmain Год назад +5

    people like you are the reason i smile at 2am after being stuck on a problem in my games. seriously, i cant thank you enough for how much information you provide and how elegantly you explain things in such a short amount of time.

  • @itaymadeit6069
    @itaymadeit6069 Год назад +15

    The only problem with this tutorial is that the series has only one episode. Amazing job!

  • @noyokay
    @noyokay 4 месяца назад +1

    MUCH MUCH LOVE for making this public! ♥

  • @JujuProdGames
    @JujuProdGames Год назад +2

    Amazing vid as always! Can't wait for part 2! ❤️

  • @rileylearns
    @rileylearns Год назад +1

    Your videos formed almost all my knowledge on platformer mechanics. Thank you!

  • @brunoaltoe100
    @brunoaltoe100 11 месяцев назад +1

    Just wanted to say thank you, this is an amazing video. I felt like I wouldn't find anyone getting more specific on how to do good platformer movement, and ended up not only with someone doing so, but also showing _how_ in a great video format. There's even a demo! Props to you, this took effort and it shows.

  • @eternalhunter5036
    @eternalhunter5036 Год назад +22

    Honestly I think this is one of my favorite channels, you keep things simple in a way anyone can understand, the editing is great, and the topics are always interesting. Keep up the amazing videos!

  • @griffinbrooks6748
    @griffinbrooks6748 Год назад +2

    this was an amazing video, i cannot wait for pt 2!

  • @crozma._.1028
    @crozma._.1028 Год назад +3

    Genuinely thank you for the extensive time and effort you put into these videos, not only doing extensive research but putting effort into making the video look good aswell. I really appreciate your work

  • @cloudy772
    @cloudy772 Год назад +2

    Wow your editing has really improved, it’s great well done

  • @JustWords101
    @JustWords101 Год назад +2

    Holy shit, this is exactly what I needed. I'm making a game all about movement and I'm really excited for part 2!

  • @jesusloves96
    @jesusloves96 Год назад +1

    This channel is a God send 🙌 🙏 seriously i am working on a 2d metroidvania and I know I am going to struggle with the programming aspect so thank you!!!

  • @amberlewis012
    @amberlewis012 Год назад +11

    Another platfomer video, this is gonna be amazing!
    Also, followed your previous tutorial on forces and movement stuff, the code needed a bit of tweaking and understanding, but once everything worked, it absolutely worked. Am excited to learn more in this video as well!

  • @konstantinosangelakis2497
    @konstantinosangelakis2497 Год назад +1

    Great video, as a new game developer your movement analysis certainly helps a lot!

  • @dekadevgg
    @dekadevgg Год назад +4

    Awesome video! Loved the editing and the information!
    Thanks.

  • @roshipatoshi
    @roshipatoshi 6 месяцев назад +1

    thank you so much! this was a very creative solution and it helped me a lot :)!!

  • @AngryFryGames
    @AngryFryGames Год назад +3

    I learned something new today. Amazing video, keep it up Dawnosaur!❤✨

  • @TacticalProgrammer
    @TacticalProgrammer Год назад +1

    Very Awesome video Dawnosaur!
    I'll be waiting for part 2 hehehe...

  • @madlad255
    @madlad255 Год назад +5

    Wow, what a video! Not only is your analysis of the movement very intuitive and well-explained, but the editing complements what you're saying really well!
    There is one thing that kind of bugged me though, but this is probably just a me-thing: there are so many editing effects (e.g. zooming in, switching between video and audio tracks, adding graphs on screen ...) happening in quick succession that it sometimes felt like an overload of information to me and was hard to follow, even though the explanation itself was great.

    • @DawnosaurDev
      @DawnosaurDev  Год назад +2

      Thanks so much! I completely agree, I went a bit over the top in this video with the pacing :D
      So this will definitely be my primary focus for future videos. Great to hear the content still felt well-explained, thanks again!

  • @michaelshollaj6428
    @michaelshollaj6428 Год назад +1

    love your videos, subscribed!!

  • @Rotaka
    @Rotaka Год назад +1

    Super cool video !! I really like that you mentioned N++, it’s one of my favorite platformers :D
    (But hey! Maybe yours’ll be the next😄)

  • @oliverpennington2308
    @oliverpennington2308 Год назад +1

    underated asf honestly this helped me sm

  • @Musibro3000
    @Musibro3000 6 месяцев назад

    Broo you just saved my LIFE👍

  • @HmmAdam
    @HmmAdam Год назад +1

    another great uploade

  • @falaghsepehr5504
    @falaghsepehr5504 Год назад +1

    really good video keep it up

  • @Locox
    @Locox Год назад +1

    YAY!!
    NEW VIDEOOO

  • @Ragthor
    @Ragthor Год назад +1

    I love this!

  • @attenurmi936
    @attenurmi936 Год назад

    OMG...take my subscription!!

  • @zaidmermam2524
    @zaidmermam2524 Год назад +1

    dude.... the quality is insane, we are looking on the next GMTK channel right now!
    good luck

  • @h33m23
    @h33m23 Год назад +1

    I was looking at part 1 yesterday, that's so weird how part 2 has been released just now.

  • @dobydaoud3346
    @dobydaoud3346 Год назад +1

    yes i need this

  • @DawidLewandowski-ev7rd
    @DawidLewandowski-ev7rd Год назад

    why u have only 3,5 k of subscribers , that is amazing

  • @lepommejamez9672
    @lepommejamez9672 Год назад +1

    How would you implement having external forces?? For instance fields that add speed to your character, or bounce pads that take momentum into account?

  • @kristophsams5036
    @kristophsams5036 Год назад +1

    This control is beyond amazing and so adaptable. My only concern is if I wanted to add slopes into the game. I've tried a few approaches, but nothing seems to work. They just slide back down and walking up the slope is like pushing a massive boulder. Is there an easy way to get the player to move up them?

  • @Aelux5216
    @Aelux5216 Год назад +1

    I implemented the momentum movement from your code and I have been struggling with taming the speed when hitting a wall and keep flying off into the distance from the momentum build up and you can cause this by pressing right against a wall and then jumping over at an angle as well like wheel spinning a car or something and enemies collision boxes are equally a problem. I have two tilemap colliders one for walls and one for ground and the edge of a tower needs to be ground on top and wall on the side but that doesn't seem that possible. Additionally if I made it both it means anytime landing on an edge it would reset the speed and lose momentum which means jumping between platforms isn't as fun anymore, additionally when wall jumping if I made it lower the speed then you always jump between walls with the same speed as well. I am open to any advice on this even if I need to redo my entire walls and ground setup.

  • @s8ck_smo
    @s8ck_smo 7 месяцев назад

    Great tutorial but is their a way to cap the speed so that it doesn't keep on increasing

  • @kbg12ila
    @kbg12ila Год назад +2

    I've been starting my game with a more Celeste style movement but I think a hollow knight style movement may actually be better for the game I'm making.

  • @yF-gb2kh
    @yF-gb2kh 8 месяцев назад

    Hello, I have a question about PlayerData. I would like to know how runAccelAmount is calculated. I would like to know your code design ideas, but I cannot understand this part. I would like to ask for advice。And thank you for your video. It's the best video I've ever seen and done so far

  • @ChronoJules
    @ChronoJules Год назад +1

    Youre a fucking legend for this is there a dono link? Youre far too kind for making it publicly available

    • @DawnosaurDev
      @DawnosaurDev  Год назад

      Thanks a lot!
      I do! www.paypal.com/donate/?hosted_button_id=DRE69AWE76ZTN

  • @pu55yEaterr
    @pu55yEaterr Год назад +1

    he finally posts after almost a year!1!!!!111

  • @eriana_
    @eriana_ Год назад +1

    I'm having some trouble using the script, everything works great, and I've gotten the movement how I want it, so first off thank you! It's amazing that you've made it free and easy to use! Although I'm having trouble with infinite jumps, I think it's the ground check not working properly, even though I followed the github page instructions, and I'm not sure what to do as I'm too nervous to mess with the commands directly. Any clues on what might be causing it, or ideas to try to fix it?

    • @duhanavc6773
      @duhanavc6773 10 месяцев назад

      did you solve the problem I am having some what same I think my problem is related to layers

  • @abdoulraoufgambo
    @abdoulraoufgambo Год назад +1

    yeahhh !!!

  • @mhcrafting42
    @mhcrafting42 Год назад

    I have a change animation function. Where in a movement script like this do I put the animation changes?

  • @muneebdev
    @muneebdev Год назад

    Still waiting for the next episode!

  • @SuperMinecraft567
    @SuperMinecraft567 Год назад +2

    Hey in your previous video you recommended a circle collider for tileset games, i have a problem tho, my character keeps sliding of the tiles corners because of the circle shape, is there any way i could fix that?

    • @DawnosaurDev
      @DawnosaurDev  Год назад +3

      Yeah, because of this I've started using a normal box collider and then making my tile maps a composite collider instead. This has worked great for me so far 👍

    • @SuperMinecraft567
      @SuperMinecraft567 Год назад +2

      Oh okay, thanks! Do you have any recommendations whether i should use polygons or Outline? And any other tips in the tilemap settings department?

  • @dandylion06
    @dandylion06 Год назад +1

    Your movement breakdown has really helped me get a great feeling movement. But there is one thing I have bee trying to solve for a while, with many failed attempts. That is slopes, it seems like when i get slope movemnent working i need to sacrifice someting else and I don't like that. I know how slope movement works, but with acceleration based movement that looks at speed diufference in can cause problems when forcing like jumping are applied. This isn't a problem when only doing x velocity, but for slopes there is also y velocity. Does anyone have a difinitive and clean way of inplement slopes? Thank you very much though, if slopes don't work out then I will leave it out of my game until a solution comes its way.

  • @emilydavidson8844
    @emilydavidson8844 3 месяца назад

    There’s an issue with this where my character is slower moving to the left and doesn’t get affected by decceleration, but the moving right works fine, any ideas?

  • @user-cg7sn7qr2n
    @user-cg7sn7qr2n 9 месяцев назад

    Can I use this in my game? (proper commercial game) what license is this?

  • @juangomez3295
    @juangomez3295 Год назад +1

    Hi man, thanks for the amazing video, I'm trying to implement the player data but I don't know wich are the values for the fields in PlayerData and I can't extract them from the repository. Can you help me plz with the values for Hollow knight type plzzzz :D

    • @DawnosaurDev
      @DawnosaurDev  Год назад +2

      Thank you! Ok, so I've just uploaded images for each of the characters to the demo on itch. If you look on the right-hand side of the page below the main game window they should all be there :D
      dawnosaur.itch.io/platformer-movement-demo-2

  • @Gcarrington820
    @Gcarrington820 Год назад

    How is it when i try to implement the script, even in the Demo Project i can only look left and right and not experience any gravity, not be able to move or jump?

  • @MxstereedYT
    @MxstereedYT Год назад

    also, What's the use of "jumpHangGravityMult" and "jumpHangTimeThreshold", and which valors should i give to them?

  • @dagentleman486
    @dagentleman486 Год назад +1

    Hey I love your videos and I have learned so much from them, but I have this problem that am trying to fix for like 3 days and its driving me mad
    For some reason whenever I add a Physics Material 2d to the player and set the friction to 0 wall jumping doesn't work properly.. whenever I have vertical positive velocity it just doesn't jump, only at the apex of my jump or when i have negative y velocity it jumps, u have any idea what causes this or how to fix it?
    Again love the content, waiting for the next vid

    • @DawnosaurDev
      @DawnosaurDev  Год назад

      Sadly not, my best suggestion would have to be to try debugging each part. I'd say try first checking if the ground detection is messed afterwards next best idea would be an issue with applying the jump force. Sorry this isn't a super helpful answer and for taking ages to reply. Let me know if you're still having issues and ill try and help out :D

    • @arrowjam6737
      @arrowjam6737 Год назад +1

      Put a capsule collider

  • @MxstereedYT
    @MxstereedYT Год назад

    hey, i'm trying to add a Gliding ability into your code but every time i put this new line of code and start the game, the character start floating with close to no gravity.

  • @awewalk-ld7fz
    @awewalk-ld7fz Год назад

    I had a doubt
    I am an bigner with coding,
    I wanted to use this to make my fps controller how can I do it
    Pls help

  • @domedin9894
    @domedin9894 Год назад

    what should the value of accelerate be ideally?

  • @MotipTV
    @MotipTV Год назад

    Is there any easy way to make it work on mobile input?

  • @duhanavc6773
    @duhanavc6773 10 месяцев назад

    I ve set everything except Layers n Tags section I ve tried to create a layer named GroundL and then I ve changed my ground objects layer to GroundL and did the same to player movements inspecter layer value but even if I did this My player wont jump and if I change my players layer to GroundL my player can jump İnfinitely how can I adjust Layers and Tags Section Thanks for the help in advance

    • @duhanavc6773
      @duhanavc6773 10 месяцев назад

      I ve installed the demo and almost copied everything after that other than script because it has dash and animator thingies but other than that its almos %100 still my character wont jump from ground it only does wall jump from walls how can I fix it

  • @trashcaster
    @trashcaster Год назад

    Is anyone else having issues with wall jumping happening (despite not being against a wall) when spamming the jump key in the air? I can't figure out how to fix it

  • @oleksandrshvets
    @oleksandrshvets Год назад

    Hi! Can you update your 2d platformer character controller for Input System?

  • @4lfr3d98
    @4lfr3d98 Год назад

    Hi, I´m currently learning how to make videogames i tried to update ur script to a 2.5D enviroment but i had some problems with the code so i wanted to ask if u can help me to solve them (of course i´m giving you the credit for the code)

  • @gauravmunankarmi9626
    @gauravmunankarmi9626 Год назад +1

    For some reason my character isn't jumping.
    I didn't want the slide and wall jump abilities so I neglected those codes.
    Apart from that I have pretty much the same code as yours but my Player won't jump.
    What could be wrong with my code??

    • @DawnosaurDev
      @DawnosaurDev  Год назад

      Hmm, so how like to approach this is going through everything that needs to happen for the player to jump such as
      1) Ground Checks
      2) Input Checks
      3) Variables (sometimes people forget to set key variables eg: coyote time of the jump buffer if you're using my code)
      etc
      4) Jump Force
      Then work through all of these and see which ones aren't working when they should. Generally when trying to fix a jump I always start by making sure my ground check is working right and working my way through the whole system. There's loads of tiny things that might be slightly wrong so I'm sure if you do this you'll get it fixed in no time.

    • @gauravmunankarmi9626
      @gauravmunankarmi9626 Год назад +1

      @@DawnosaurDev I will try that.Thx

    • @gauravmunankarmi9626
      @gauravmunankarmi9626 Год назад +1

      @@DawnosaurDev it seems the problem was that I set the value of jumpForce to 8 inside the code. I removed it and now everything works fine.

    • @samienr
      @samienr Год назад

      @@DawnosaurDev How do you suggest I write my ground checks?

  • @RGBA
    @RGBA Год назад

    2:26 maybe tutorial on that effect?

  • @pogfabr_
    @pogfabr_ 11 месяцев назад +1

    Why isn't Time.deltaTime used in acceleration code?

    • @DawnosaurDev
      @DawnosaurDev  11 месяцев назад +1

      We don't need it since all our code (that is code that's running constantly such as the run) is working within the FixedUpdate method. This will always get called 50 times a second. So we don't need to worry about changing frame rates and so don't need to use time.deltaTime.
      If you're looking for a more detailed explanation, I'd highly recommend Jonas Tyroller's video on Delta time

    • @pogfabr_
      @pogfabr_ 11 месяцев назад

      @@DawnosaurDev There is still a chance that Time.fixedDeltaTime gets longer. And a day after I commented I found that RB.AddForce() is already containing Time.fixedDeltaTime inside unless you use impulse force mode

  • @gabrieldesouza112
    @gabrieldesouza112 Год назад +1

    Is there any way to "apply forces" in a kinematic character? It doens't need to be really using the ApplyForce method, it could be with another algorithm.
    Please do not answer "You cna't apply forces in a kniematic character"...

    • @DawnosaurDev
      @DawnosaurDev  Год назад +3

      I've experimented a little bit with AddForce() and I believe under the hood the function performs a calculation along the lines of this:
      RB.velocity = new Vector2(RB.velocity.x + (Time.fixedDeltaTime * speedDif * accelRate) / RB.mass, RB.velocity.y);
      (this is a version of my line of code)
      float movement = speedDif * accelRate;
      RB.AddForce(movement * Vector2.right, ForceMode2D.Force);
      So, you could definitely try this out on a kinematic character and see how it works out :D

    • @gabrieldesouza112
      @gabrieldesouza112 Год назад +1

      ​@@DawnosaurDev Thanks! I'll try that and reply here about the result!

    • @DawnosaurDev
      @DawnosaurDev  Год назад

      @@gabrieldesouza112 Awesome!

  • @spud7234
    @spud7234 Год назад

    pizza tower: hold my toppin

  • @meghnaadvijayakar178
    @meghnaadvijayakar178 Год назад +1

    I'm making a proper commercial video game, can I use your code in it?

    • @meghnaadvijayakar178
      @meghnaadvijayakar178 Год назад

      of course, I will give credit to you in the game

    • @DawnosaurDev
      @DawnosaurDev  Год назад +1

      Yeah of course, let me know when you release anything I'd love to check it out

  • @warsin8641
    @warsin8641 Год назад

    I died

  • @LethalChicken77
    @LethalChicken77 Год назад

    Pro tip: do *not* use forces for a character controller.

  • @Stardusk.
    @Stardusk. Год назад +1

    You state that holow knight simplifies its player movement only it looks from our eye to be a limitation so to input easier coding for mechanic feed backs.
    Like insecurity, and incompetence exist in game design.
    On an empty shadow floor of the human psych.
    Celeste looks to own the elements both fluidity, and mechanical clunk [NOT worthy contrast insert concept] in the character movement.
    Dynamic-robot sure.
    Dynamic-panther for such a slim build?
    No.
    Ading a sugest element from your video.
    Responsivity when afecting movement at variable speeds, and the human sense of aceleration, and deceleration when moving on a grid scale frame.
    Meaning.
    Tai chi FOOL'S.
    Thanks art analytic break down; man.
    You help.
    Rare for people to help.

  • @brucelee7782
    @brucelee7782 11 месяцев назад +2

    man your videos are too fast!