How to Jump in Unity 3D: Jumping Like Mario [Built-In Character Controller #3]

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

КОМЕНТАРІ • 264

  • @TheJazzygeoff
    @TheJazzygeoff 3 роки тому +81

    A masterpiece, Nicky. The production quality, the graphical visualisations, the pace of the coding sections, correctly refrencing the contributions of others, and the engaging voice work.

    • @iHeartGameDev
      @iHeartGameDev  3 роки тому +5

      Thank you for such a kind comment, Geoffrey! The kindness means a lot! I hope the video helps you too!

    • @user-ef6tm3ut4r
      @user-ef6tm3ut4r 3 роки тому +1

      @@iHeartGameDev we need more like these bro

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

      Perhaps you can help me Geoffrey, I have written the code exactly as it is shown, but I get compiler errors. The main one is this: Assets\Standard Assets\Characters\ThirdPersonCharacter\Prefabs\My Scripts\AnimationMotionController.cs(48,39): error CS1061: 'PlayerInput.CharacterControlsActions' does not contain a definition for 'Jump' and no accessible extension method 'Jump' accepting a first argument of type 'PlayerInput.CharacterControlsActions' could be found (are you missing a using directive or an assembly reference?)
      I am continuing from the other two parts in this tutorial series so everything is set up as it is supposed to be, since this video has helped you, can you please help me to find where my mistake is?

    • @peonso
      @peonso 3 роки тому +1

      @@kingdom216 Start this video from scratch again, you missed some step or have a typo somewhere for sure.

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

      @@kingdom216 , as a guess, that error message suggests to me that you have not created an action called "Jump" in your input actions which you seem to have called CharacterControlsActions - you know, the place where you setup the input bindings, etc. Have you spelled it correctly?

  • @StillCisTho42
    @StillCisTho42 3 роки тому +6

    I can believe this content is free. Thank you;

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

    This is like the only 3d Platformer Tutorial that made a professional looking result that I could find. Excellent job!

  • @themodernpirate2827
    @themodernpirate2827 3 роки тому +4

    I've been waiting so long for this video to come out that I start to think he must have thought: "nah, this series are too good to be free for the general public, from now on, it will be exclusive only to patreon supporters"
    Thank you for your work, time, effort and dedication to this videos, seriously.

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

    Man, your teaching style is the best I've watched on the internet so far.

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

      Thank you Marc :) happy to hear that you like it

  • @blazhevski
    @blazhevski 3 роки тому +7

    i started making a 3d platformer prototype a while ago, while i managed to make simple movement and a simple double jump mechanic i couldn't get it quite the way i wanted it to be. excited for this video!

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

    You really do have a gift of explaining things. The composition and detail of your videos really show how much thought and work you put into them. You probably deserve more than you get from it all, but I can guarantee you that people appreciate it and that your insight is inspiring. Thank you sir

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

    The best tutorial I've seen yet since Brackeys. Tysm

  • @CosmicComputer
    @CosmicComputer 3 роки тому +1

    I can't wait for the dynamic rigidbody character controller series!

  • @AlexBlackfrost
    @AlexBlackfrost 3 роки тому +4

    Loved it! You did a pretty good job explaining complex topics like Verlet vs Euler in such a way that it is easy to understand.

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

    You. Are. A GOD!!! Just subscribed and I'm now going to binge watch all your content. Best game development tutor hands down.

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

    I nver see this quality in a channel i love this

  • @rogerwarford1517
    @rogerwarford1517 2 роки тому +9

    Love these videos! For what it's worth, there is a small error in handleJump() (26:09 in the video). Lines 75 through 78 should be:
    float secondJumpGravity = (-2 * (maxJumpHeight * 1.5f)) / Mathf.Pow(timeToApex * 1.25f, 2);
    float secondJumpInitialJumpVelocity = (2 * maxJumpHeight * 1.5f) / (timeToApex * 1.25f);
    float thirdJumpGravity = (-2 * (maxJumpHeight * 2f)) / Mathf.Pow(timeToApex * 1.5f, 2);
    float thirdJumpInitialJumpVelocity = (2 * maxJumpHeight * 2f) / (timeToApex * 1.5f);
    Note that we are multiplying by 1.5 and 2.0 rather than adding 2 and 4. This only matters if maxJumpHeight is set to a value other than 4.

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

      I know this comment is a year old now, but would you call this an error or a preference? I personally prefer the addition and not the multiplication for any value of maxJumpHeight

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

      @@clintonmansfield6364 I personally consider this a bug because if you do addition the second and third jump are not proportional to the first jump. So for example if maxJumpHeight is 2, then the second jump will be double the regular jump, rather than 1.5 times. Likewise if maxJumpHeight is 8, then the second jump would only be 25% of the initial height. I think this would be confusing if you tried to reuse this code and needed a different maxJumpHeight.

  • @Dominik-K
    @Dominik-K 2 роки тому +2

    Thanks a bunch as this is really a great tutorial and I have to say it explains the concepts and implementation very succinct and precisely.

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

      Thanks very much Dominik! I tried my best!

  • @stuartmurton7319
    @stuartmurton7319 3 роки тому +1

    I have watched a lot of tutorial stuff over the years (including Udemy) and this channel is by far the best content I have come across. Going to check out the patreon!

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

    I would like this video a thousand times if I could. thanks a lot man.

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

    Another great video Nicky! Excited to see more!

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

      Thank you Sig!! Hope all is well, buddy!

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

      @@iHeartGameDev Aswell as one can be in these times! Hope you're doing better!

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

    We are all definitely not in the same space 2yrs later. This is still gold though. I think I have about all of Nicky's videos in some kind of referenced playlist. Right now, im making a jump mechanic that i hope to be as flexible as possible. Im just starting my gamedev journey but I'm an oldschool c/c++ and even some c# coder.. I guess we'll see what the future holds. Im excited and here for itmm hopefully the world doesn't go WWIII before I make my first game.

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

    While info in your videos is simply "really good", your editing level is over 9000. Thank you.

  • @HyagoPinheiro
    @HyagoPinheiro 3 роки тому +9

    Great tutorial. Thanks :)
    You could replace Mathf.Pow(timeToApex, 2) by timeToApex * timeToApex (line 67 at 11:30)
    Pow is an expensive function.

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

      Glad you liked it! And that is great to know! Thank you for sharing the knowledge!

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

    Aaah yes thank you for this video! This is the first time I've seen the state machine animation block and I'm blown away, I wish I discovered it sooner. This approach to jump is really useful and you can easily modify it to work with rigid bodies. Very cool

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

      Awesome Paulo! Happy to hear that it has already helped you 😊

    • @zebulon.a
      @zebulon.a Рік тому

      my apologies for the year old comment. How do you convert this for rigid body instead of character controller?

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

    This channel is gold! Thank you!!

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

    Thanks this was lifeline it made the jump look realistic and normal.

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

    You have been sent by the codings gods! Thank you so so much I hope I can get to see more of your tutorials and hope to learn as much as possible!!!!

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

    Incredible tutorial! Very easy to follow and with great instructions!

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

    Huge thanks to you, Nicky!!!
    This is a GREAT TUTORIAL

  • @DHrUVSpY
    @DHrUVSpY 3 роки тому +1

    Thank you so much, Nicky. Your content is saved my time. you're amazing at explaining full of meaning each code. Request for explain follow camera to character

  • @VojtaKoci
    @VojtaKoci 3 роки тому +11

    Oh damn, your tutorials are just the best... As an animator myself, I'm really glad that you keep the channel a bit "animation-heavy", but your coding is just so well executed. Even though I usually already know most of the things you're talking about in your vids, I always watch every single one of them, because they are probably the best Unity-centric content available. You're doing a great job man, thank you very much!
    Also I was wondering if you considered telling us something about inverse kinematics? I mean, most of it is quite well covered (at least quantitatively - there's quite a lot videos on that topic), but the tutorials are most often quite incomplete and not well done. There's surprisingly very little video material on well executed 2D runtime rigging, but I guess 2D is not your cup of tea. But any in depth tutorial on runtime rigging would be great!
    Cheers from Czech Republic, thank you for your vids, keep up the great work and have a great day!

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

      Wow what a fantastic comment! Thank you so much for watching and for the kindness 😊
      Regarding IK: I actually haven’t really ever used it myself. I think I’ll be getting to it eventually as we cover more topics on the channel!

  • @epiksol_
    @epiksol_ 3 роки тому +1

    Great job, Nicky! Keep it up!

  • @sngaulin
    @sngaulin 3 роки тому +1

    Wow, I started the serie just to get a refresh on character controllers but damn yours is getting good and so simple to understand so we can mod it that I'm just going on Patreon to get access to the file! Awesome job! Keep going!

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

      Awesome to hear, thank you! Please let me know if there’s any issues downloading the files 👍

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

    I've been looking everywhere for a proper analysis and implementation of Mario's jump. Not a Unity developer, but the production quality, explanations, and results are so good that I am considering attempting to apply the logic to Unreal.

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

      Hey thanks so much for the kindness!!

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

    This is a great tutorial which has been really helpful to me. Thank you ☺

  • @mihaistanciu2487
    @mihaistanciu2487 3 роки тому +14

    The biggest problem in jumping is to be able to sync the animation with the actual jump. You chosed some settings on animations without any explaination of why you did that or what that mean(like set the root transform position etc). Judging on your previous videos I was expecting more. Anyway, keep up the good work.

    • @iHeartGameDev
      @iHeartGameDev  3 роки тому +7

      Hey - thanks for watching! I tried my best here to replicate Mario’s instantaneous transition and stated why we were modifying the transition duration to allow the animations to blend better. There should be bits of explanation for most everything incorporated in the video, including why we were modifying animation transitions.

    • @andresinish
      @andresinish 3 роки тому +1

      For me the static poses weren't working for me, because the timing was a little off, but i replace them with some actual animations and it was a whole lot smoother and the timing was way better, i guess you could try that instead. :)

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

    love this channel contents,
    very very helpful tutorials.
    Many Thanks

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

    I love this video, and I really think most of your vids deserve more views! Amazing anaylsis/breakdown!

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

    Love the series awesome job! Looking forward to the the next series!

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

    Deserves more subs

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

    Thank you Mr.Nicky!!

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

    This was very helpful!

  • @momozaki4453
    @momozaki4453 3 роки тому +1

    WAITING!!

  • @odinniereece4096
    @odinniereece4096 3 роки тому +1

    🙂🙂Wonderfully explained Nicky great work... Keep it up..

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

      Thank you for the kindness Odinnie! Great to see familiar faces around here :)

    • @odinniereece4096
      @odinniereece4096 3 роки тому +1

      @@iHeartGameDev ☺️☺️☺️ I see... You remembered me...

    • @odinniereece4096
      @odinniereece4096 3 роки тому +1

      @@iHeartGameDev I honestly never thought youtubers would remember the persons who comment on their videos...

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

      I can’t speak for everyone, but I try to!

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

      @@iHeartGameDev thats great.. I actually like that about you

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

    I used the clearly-presented info in this video to clean up messes I made following other tutorials :D

  • @FAISAL-ky7ps
    @FAISAL-ky7ps 3 роки тому +1

    I always love your tutorial XD

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

    Excellent ! thank you very much !!

  • @timarlow8007
    @timarlow8007 3 роки тому +16

    This guy is the new Brackeys but better

    • @iHeartGameDev
      @iHeartGameDev  3 роки тому +1

      Thank you for such a kind comparison!

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

    Me who dosent know how to code and dosent understand any unity tutorials: cool 👍

  • @Somiaz
    @Somiaz 3 роки тому +4

    I'm curious and also stuck, how can I make the character turn in the direction the camera is pointing while also keeping all the rotation code from before?

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

    Thanks!

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

    Amazing.

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

    Mind blowing explanation. Greatest ❤💙❤ .Make a video on Pun 2 multiplayer ❤💙❤

  • @ramaarya2157
    @ramaarya2157 2 роки тому +10

    I've followed the tutorial until 12:42 minutes, but when I enter play mode, my character doesn't jump. Even though I've followed all the code. any suggestions for me? thank you, your tutorial is very good (sorry if my english is bad)

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

      Same here, I reckon that the issue lies in the fact that we never use the jump variables anywhere else. Being a total beginner in c#, I can't figure out where to put it too ^^'

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

      had the same problem, just follow until 16:28

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

      any other solution i followed the video but nothing happens
      Edit: i fk up in the variables and my velocity was negative thats was my problem xD

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

      Between the videos, he adds "* Time.deltaTime" into the handle gravity function. Mine wasnt working either till I added those, guess he accidently forgot to put it in the video to add it from the previous one

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

    thank you

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

    Isn't an Array faster than a Dictioinary?

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

    Loving these tutorials, any chance we can get one on adding a camera to the player using cinemachine?

  • @ichliebelongboarden
    @ichliebelongboarden 6 місяців тому

    Very helpful, thanks. There is a correction though. When you land back on the ground, the y velocity is 0 and so is the acceleration. This is because you are no longer moving vertically. If your y velocity was nonzero, then you'd be moving vertically. If your y acceleration is nonzero, then your vertical velocity would be changing. Neither of these are true, so both y vel and acceleration are zero.
    Also, your Verlet integration isn't correct. You are effectively just doing Euler integration with half the acceleration you want and declared with the gravity variable. Simply put, Verlet integration yields v(t+dt)=v(t)+.5(a(t)+a(t+dt))dt, which in the case of constant acceleration like we have here, that is the same as Euler integration (because a(t)=a(t+dt)). You only want Verlet integration if you have non-constant acceleration. So just use Euler integration with gravity cut in half, if you like the effects of what your code did.

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

    I know I'm a year late to this, by why use a pair of Dictionary. They're expensive to look up.
    Why not have used a single (float Velocity, float Gravity)[]? Where index 0 is the first jump, index 1 is the second, and so on?

    • @radiofloyd2359
      @radiofloyd2359 5 днів тому

      1 Array for pairs would defeat the point of the array, but yeah I was slightly raging over him using a dictionary only to use integers as keys.
      That being said, hashtables this small are almost as fast as the array, it's just funny that he went through the trouble of hashing components only to use a dictionary where an array is obviously faster.

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

    regarding the physics, there is a bit of a confusion between Acceleration and Velocity. But we get your point ;).

  • @bovineox1111
    @bovineox1111 13 годин тому

    Hmmm, I think I might Patreon for a bit as I can't see how this is working. You're calling Move above gravity and jump which suggests the Y need to persist frame to frame but you're also setting the Y * Time.deltaTime and then when currentMovement is applied it gets multipled out again???

  • @shammahcharles4941
    @shammahcharles4941 10 місяців тому +1

    Can you please make one for melee combat! please!

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

    the gravity snaps the player into the ground and it cannot jump is there any fix for the gravity, i followed the tutorial before about the gravity and it was snapping player to the ground too. how am i gonna get it to jump if its snapping!

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

      try disabling "apply root motion" in the animator

  • @hermanator5543
    @hermanator5543 3 роки тому +4

    ​Hello, could you please include the smoke particles trail that Mario has in this tutorial? It would be awesome and I would really appreciate it XD

    • @iHeartGameDev
      @iHeartGameDev  3 роки тому +3

      Hey Hermanator! Unfortunately that’s one of the few things I don’t cover. The video is my longest yet and adding in the particle effect would have added even more! Maybe that would be a great short video to make after though! I’ll include it in the next Patreon poll 🙌

    • @hermanator5543
      @hermanator5543 3 роки тому +1

      @@iHeartGameDev okay, thanks!

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

    Came for the video game mechanic tutorial, stayed for the applied calculus lesson

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

    Hi, I was wondering will you do a momentum based movements tutorial ? Like the Mario one we can see in odyssey, etc. Would be interesting to see it. Like how would you manage acceleration, deceleration in the air and on the ground 👍

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

    Hi @iHeartGameDev! First of all, thanks for the amazing tutorials. I want to give some feedback on the jump button release: Wouldn't it be nice if we set a min jump height for the "jump button release"? If there's no min jump height, then when you spam the jump button rapidly there gives inconsistent jump arcs and that feels really bad. If you take Hollow Knight as an example, when you tap the jump button rapidly the character hops quickly but with the exact same jump height (which is the minimum jump arc/parabola/or time, depending on which implementation is used), so the arcs of the jump for the min jump are always constant.
    The last time I coded the min jump I did it by comparing 2 things in fixedUpdate: (1) Jump Button UP and (2) the current Y velocity is less than a threshold that you set (this threshold could be your "initialJumpVelocity" - "a small amount (for instance, minJumpVelocity = initialJumpVelocity * 0.9f)". If the initialJumpVelocity is 10, then the minJumpVelocity = 9). This ensures that at least the character is going to travel a minimum distance (the distance travelled from the initialJumpVel until it reaches the minJumpVelocity by deceleration) before falling back down. A drawback of this implementation is that is less intuitive to set up, because you have to test the values until you find the min distance travel that you like for your jump.
    My question is, given your current implementation, is there a better way to set this minimum Jump height that suits the rest of the Jump with the verlet integration? The one I suggested would do it (In fact, I tested with 60fps and with 800fps and the results are very consistent across framerates), but its consistency is similar to the euler approach, there are still a really tiny amount of error, not really noticeable for a normal jump. However, if you set the jumpHeight to a really large number, then the inconsistencies could be a bit more noticeable (still low though, but worth to be corrected).

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

    Hey there! 🙂
    I am in the middle of your video, currently testing the first Jump attempt and… Well for some reason, unlike you, the character isn’t jumping much (1cm in 0.01s) 😂
    It’s seems like gravity is super strong etc, but I watched your code again and again and it’s similar.. any idea what it can be related too?
    I have cubes falling as expected, but for the character, even starting from the sky with no action, it lands at top speed..
    Weird 😬
    Nice videos I must admit, very clear and super interesting, even for advanced dev 🙂
    Thanks

  • @gowtham27501
    @gowtham27501 3 роки тому +1

    Great work ,do you kown why no video in mix and jam for long time

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

      Thank you! I'm not sure about Mix And Jam. But André's videos are some of my favorites as well!

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

    Awesome tutorial! Can we do camera controls next?

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

    Maybe the next video will be about how to make a combat system?

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

    Wow just perfect, it works sooooooo well! Anyone know how to add air control while jumping? Is there a way to isolate the y velocity of the player rather than use current movement.y?

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

    you sure did put a lot of thought into jumping

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

    Am I losing my mind or is anyone else getting a glitch where gravity sets itself to a random number and the jumps just DONT work?

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

      Error resolved! at 12:29, the original gravity function in handleGravity was changed without comment. The handleGravity function should look like this:
      void handleGravity()
      {
      if(characterController.isGrounded)
      {

      currentMovement.y = groundedGravity;
      currentRunMovement.y = groundedGravity;
      }
      else
      {
      currentMovement.y += gravity * Time.deltaTime;
      currentRunMovement.y += gravity * Time.deltaTime;
      }
      }
      the += gravity * Time.deltaTime is essential to making the jump work properly!

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

      @@joeymowery6124 Oh my gods thank you, I had no idea what I was doing wrong here.

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

      @Sorcha Murray It gets thrown out and replaced later in the course, but I have a hard time focusing on making changes when where we're supposed to be isn't working. Glad it helped!

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

    I watched the animation series and I am working to make cool jumps. I would like to know more than unity.physics. the code I am using is:
    Rb.velocity=velocity.y+float.
    It works fine but the problem is that I want my object to look heavy. But useGravity is a bool and API is not accessible. Plus due to zero air resistance mass doesn't make any change.

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

      Hey Sufian! Thanks for watching the series on animation! Currently I’m not handling rigidbody physics. I think we’ll get there eventually though so stay tuned!

    • @Bidule200
      @Bidule200 3 роки тому +1

      Gravity value is accessible in Project Settings > Physics (default is 9.81 like on Earth). It's a global setting, so you can't tune it for every object. For air friction (what makes objects look light or heavy) the rigidbody parameter to tune is Drag (and Angular Drag).
      Anyway, you shouldn't use default Gravity for a playable character, you should compute your own and apply it as a vertical acceleration when your character is not touching the ground.

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

      @@Bidule200 I am going with your answer thanks :)

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

      @@iHeartGameDev After GDC, it looks like the case study of their theory. And man you just nailed it. Thanks to be here!

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

    How to prevent steering during jump and continue after touching ground? Switch off steering and buffer input somehow.

  • @samarabosarah5191
    @samarabosarah5191 6 місяців тому

    Can You Make A double Jump move

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

    Will u be making any animation tutorials? Like in blender how to animate instead of taking them from Mixomo for example animations like Jump, Run, Idle, Slide, Crouch and all that. Would be greatly appreciated

  • @NikkuRajpoot-yl3nb
    @NikkuRajpoot-yl3nb 4 місяці тому

    Bro i have a question why don't you write the gravity value to -9.8?? as i have seen other tutorials of jump mechanism they are just using -9.8 and it just confusing me ?? as i don't have much knowledge about physics.
    Hope so you get my point and sorry for any confusion made my me in advance

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

    10/10

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

    ily

  • @Dudoi
    @Dudoi 3 роки тому +1

    Hi, just amazing these character controller tutorials.
    I'm learning about game developing and programming and I loved your way of explaining.
    As I remember Mario doing the 3 jumps without pauses when touching the ground, I tried to apply the same concept in case the jump button is pressed as soon as you hit the ground execute the second jump by changing the if of "handleJump" to " if (characterController.isGrounded && isJumpPressed)" is there any problem I didn't notice when removing !isJumping?
    Thank you very much for the tutorial

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

      Hey! You are free to experiment and try out any changes and refractors you want! No big deal!

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

    This video is really informative. I'll definitely be able to use some of this stuff for a kinematic Rigidbody character controller.
    Just need to convert from the CharacterController, I've wasted so much time on.
    Try doing jump-through platforms, without turning off the platform's collider.
    Spoilers.
    You'd think using the collider.isTrigger = true; function of CharacterControllers would do it.
    It doesn't.
    CharacterController controller;
    controller.detectCollisions = false;
    Doesn't actually do anything.
    I'm in 2019.4.29f1, so ymmv in the 2020 version, but it simply doesn't actually do anything in my version.

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

    if im using rigidbody is the same but rb.velocity = currentMovement ? thnx for this tutorial!!!

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

    Nicky, please, i need your help! how can i do a ledge grab? i tried everything but nothing worked. You have a big fan from Brazil!

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

    my character jumps so high that they just disappear in less than a second please help

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

      I'm having the same issue. Were you able to fix this? It seems as if somehow gravity must not be applied to the jump to slow him, but I'm not certain if that's the case. I'm not getting any errors , but jumping just takes me out of the screen.

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

      @@graytreegames6151I sadly couldn't fix it

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

      @@Blueskies2513 That's unfortunate. I've managed to isolate the issue to the verlet implementation. The character jumps fine before adding in the "previousYVelocity" coding, but after, zoom through the roof. Not sure what in that code is causing it. I may end up going with another controller, or being happy enough with the simpler version of the jump for the time being with my time constraints.

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

      @@Blueskies2513 I solved the issue. It's a small detail in the video, but when resolving the string of "previousYVelocity" variables, the final set needs to be changed to "=" and not "+=". It's a small detail, but it makes a huge different. He does say that in the video, but it's easy to miss.

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

      @@graytreegames6151 oh wow, it aactuaoy woiied

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

    Can u make GROUND POUND attack with character controller

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

    Amazing. Is it easier to just have a blend tree for idle, walk, and run to simplify the transitions/have only one movement logic for the character controller, or does this not work properly?

  • @jroc6745
    @jroc6745 3 роки тому +1

    Great tutorial thanks for posting. I have a question, currently the character stays in the jump animation the entire jump. How do you impliment a falling animation once the character reaches the apex of the jump?.

    • @iHeartGameDev
      @iHeartGameDev  3 роки тому +3

      Thanks! There is logic already in the script that incorporates checking if the character is falling. Seems like a solid spot to switch the animation too!

  • @angelkaki5707
    @angelkaki5707 11 місяців тому +1

    Does anyone have an idea of how to make the 3rd jump stationary n not actually make you move??

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

      try disabling "apply root motion" in the animator

  • @michaelpestanaluis-gamedes3518
    @michaelpestanaluis-gamedes3518 3 роки тому +2

    I've encountered a problem after finishing all the areas until 19:00, when pressing jump my player gets yeeted, so to make small jumps i need to lightly and quickly tap the jump button, any idea how I can fix this? I've gone through the code 3 times and it's all the same.

    • @JahidulIslam-ev1zo
      @JahidulIslam-ev1zo 3 роки тому

      I am having the same issue, have you found a solution?

    • @JahidulIslam-ev1zo
      @JahidulIslam-ev1zo 3 роки тому +3

      Nevermind, my solution was that
      float previousYvelocity = currentMovement.y;
      float newYvelocity = currentMovement.y + (gravity * Time.deltaTime);
      float nextYVelocity = (previousYvelocity + newYvelocity) * 0.5f;
      currentMovement.y = nextYVelocity;
      it was currentMovement.y += nextYVelocity; before and now i removed the plus and its fine.

    • @michaelpestanaluis-gamedes3518
      @michaelpestanaluis-gamedes3518 3 роки тому +4

      @@JahidulIslam-ev1zo Just saw your reply, and it worked for me, although I had to change the 'currentRunMovement.y += nextYVelocity to currentRunMovement.y = nextYVelocity as well, as the same problem would occur when running and jumping at the same time

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

    Awesome tutorial! i've come upon an issue that when I do my second or third jump without moving the animation becomes weird. While I move it works perfectly though. Do you know how to fix this?

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

    Hello Nicky! Couls you please explain me why you modify the initialJumpVelocity at 16:14? Wouldn't it just work like it is?

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

    I have an issue where when I am running then jump, when my character lands, and I am still holding the shift key and a direction key, the jump animation continues to play indefinitely. Changing any input I am pressing will work fine and animate properly.

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

      same problem here, any solution? thanks

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

      @@JackTransistor Any Luck??

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

      @@symmetrythomas7376 Hi, sorry but then I realized that i needed a different character controller, and from this video I kept only the handle gravity for the progressive jump.

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

      I know it may seem a bit long from your question, but I solved this today. In the transition from Jump to Run you have to turn both conditions - isWalking and isRunning to true, because technically, when you hold your movement keys and your run keys, both of them are set to true :)

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

      @@stanisawksel4682 wow, this came in just in time for me lol. Thank god you decided to respond

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

    is there a reason we don't just do the physics calculations (gravity) in fixedupdate?

  • @septimania3483
    @septimania3483 3 роки тому +1

    I have these errors:
    - PlayerInput.CharacterControls.Jump.started += onJump; error CS0120: An object reference is required for the non-static field, method, or property 'PlayerInput.CharacterControls'
    - PlayerInput.CharacterControls.Jump.canceled += onJump; error CS0120: An object reference is required for the non-static field, method, or property 'PlayerInput.CharacterControls'
    - currentRunMovement = nextYVelocity; error CS0029: Cannot implicitly convert type 'float' to 'UnityEngine.Vector3'
    How do I fix them

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

      I am getting different errors and it doesn't seem that there is anyone to address these issues.

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

      It sounds like you haven’t set the reference to an instance of PlayerInput. If you haven’t watched the previous episode, you need to.

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

      @@iHeartGameDev I resolved the problem.
      Could you make a tutorial when you fix a rotative camera to this character (with right joystick)?

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

    How would you apply this to knock back force using the character controller and Collision detection?? PLease help

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

    How do we prevent our character from falling through the ground in the jump Router? My character falls through the ground when it is in the jump Router because there are no animation. Should we have something to prevent falling?

  • @baddie.gamies
    @baddie.gamies Рік тому

    I am pretty sure someone has asked this but why didn't you use the "Any State" for the jump animation?

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

    yeah... my jump just immediately zips to the peak, of which is a very small jump. it's not calculating per frame on the way up, only way down -__-

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

      so turned out it was my raycast for my ground detection causing it - no idea how to fix it so gave in and used the character controller isgrounded instead -__-

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

    Hello I love your videos but for some reason if I hold dow the jump button my character keeps jumping. Is there anyway to stop it

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

    Hey is there a way to change the handleRotation method to rotate with the mouse instead of the WASD keys?

  • @tigeralt302
    @tigeralt302 3 роки тому +1

    This is so great!
    I do have some questions:
    Why do we need to calculate the gravity again if we already set it to a number? Is it to make the controls feel better? (Is that explained in the talk you referred to?)
    And why is the Jump/Falling still frame dependent if we are multiplying it by Time.deltaTime?

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

      I had this question but then I realized the answer. He isn't moving the character to jump, he's manipulating the gravity.