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

  Рет қаралды 101,926

iHeartGameDev

iHeartGameDev

Күн бұрын

Пікірлер: 266
@TheJazzygeoff
@TheJazzygeoff 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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?
@blazhevski
@blazhevski 3 жыл бұрын
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!
@StillCisTho42
@StillCisTho42 3 жыл бұрын
I can believe this content is free. Thank you;
@MarcV_IndieGameDev
@MarcV_IndieGameDev Жыл бұрын
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
@clintonmansfield6364
@clintonmansfield6364 9 ай бұрын
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
@darth6129
@darth6129 7 ай бұрын
This is like the only 3d Platformer Tutorial that made a professional looking result that I could find. Excellent job!
@anshpudaruth5549
@anshpudaruth5549 2 жыл бұрын
The best tutorial I've seen yet since Brackeys. Tysm
@signalised9540
@signalised9540 3 жыл бұрын
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!
@stuartmurton7319
@stuartmurton7319 3 жыл бұрын
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!
@AlexBlackfrost
@AlexBlackfrost 3 жыл бұрын
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.
@paulorodriguez6288
@paulorodriguez6288 3 жыл бұрын
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?
@rogerwarford1517
@rogerwarford1517 2 жыл бұрын
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 9 ай бұрын
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 9 ай бұрын
@@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.
@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.
@Hoptronics
@Hoptronics 6 ай бұрын
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.
@tarekmustafa2525
@tarekmustafa2525 Жыл бұрын
This channel is gold! Thank you!!
@iHeartGameDev
@iHeartGameDev Жыл бұрын
thanks so much!
@themodernpirate2827
@themodernpirate2827 3 жыл бұрын
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.
@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 жыл бұрын
Hey thanks so much for the kindness!!
@SanyaBane
@SanyaBane Жыл бұрын
While info in your videos is simply "really good", your editing level is over 9000. Thank you.
@VojtaKoci
@VojtaKoci 3 жыл бұрын
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!
@Dominik-K
@Dominik-K 3 жыл бұрын
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 3 жыл бұрын
Thanks very much Dominik! I tried my best!
@drepp1398
@drepp1398 2 жыл бұрын
I nver see this quality in a channel i love this
@iHeartGameDev
@iHeartGameDev 2 жыл бұрын
Thanks very much!
@CosmicComputer
@CosmicComputer 3 жыл бұрын
I can't wait for the dynamic rigidbody character controller series!
@sngaulin
@sngaulin 3 жыл бұрын
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 👍
@epiksol_
@epiksol_ 3 жыл бұрын
Great job, Nicky! Keep it up!
@BFFUWGTHAFO
@BFFUWGTHAFO 2 жыл бұрын
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!
@mihaistanciu2487
@mihaistanciu2487 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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. :)
@DHrUVSpY
@DHrUVSpY 3 жыл бұрын
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
@markodhiambo6457
@markodhiambo6457 Жыл бұрын
Thanks this was lifeline it made the jump look realistic and normal.
@OfficialSiem
@OfficialSiem 3 жыл бұрын
I love this video, and I really think most of your vids deserve more views! Amazing anaylsis/breakdown!
@tigranavagyan1587
@tigranavagyan1587 Жыл бұрын
Huge thanks to you, Nicky!!! This is a GREAT TUTORIAL
@ninjedi6710
@ninjedi6710 2 жыл бұрын
Deserves more subs
@iHeartGameDev
@iHeartGameDev 2 жыл бұрын
Thank you
@castlecodersltd
@castlecodersltd Жыл бұрын
This is a great tutorial which has been really helpful to me. Thank you ☺
@tamilmaran4000
@tamilmaran4000 3 жыл бұрын
I would like this video a thousand times if I could. thanks a lot man.
@alienouz
@alienouz 2 жыл бұрын
love this channel contents, very very helpful tutorials. Many Thanks
@fulongfromthegrave
@fulongfromthegrave 3 жыл бұрын
Love the series awesome job! Looking forward to the the next series!
@Somiaz
@Somiaz 3 жыл бұрын
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?
@odinniereece4096
@odinniereece4096 3 жыл бұрын
🙂🙂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 жыл бұрын
@@iHeartGameDev ☺️☺️☺️ I see... You remembered me...
@odinniereece4096
@odinniereece4096 3 жыл бұрын
@@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
@UkeyMusicLEAKS
@UkeyMusicLEAKS Жыл бұрын
Me who dosent know how to code and dosent understand any unity tutorials: cool 👍
@ramaarya2157
@ramaarya2157 2 жыл бұрын
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 ^^'
@silverpixeldev
@silverpixeldev 2 жыл бұрын
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 жыл бұрын
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
@rydergetson
@rydergetson 2 жыл бұрын
This was very helpful!
@HyagoPinheiro
@HyagoPinheiro 3 жыл бұрын
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 жыл бұрын
Glad you liked it! And that is great to know! Thank you for sharing the knowledge!
@GamingFragz1i
@GamingFragz1i Жыл бұрын
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 8 ай бұрын
try disabling "apply root motion" in the animator
@FAISAL-ky7ps
@FAISAL-ky7ps 3 жыл бұрын
I always love your tutorial XD
@iHeartGameDev
@iHeartGameDev 3 жыл бұрын
Thank you!!! I hope it helps!!
@momozaki4453
@momozaki4453 3 жыл бұрын
WAITING!!
@theunluc1508
@theunluc1508 3 жыл бұрын
Thank you Mr.Nicky!!
@jadonmullinex9389
@jadonmullinex9389 3 жыл бұрын
I used the clearly-presented info in this video to clean up messes I made following other tutorials :D
@celsoae
@celsoae 2 жыл бұрын
Hi o/ Dunno if is something related to the scale of the objects of my scene. But when i press jump my character skyrocket and i got an error that says: "due to floating point precision limitations, it is recommended to bring the world coordinates of the GameObject within a smaller range". Can you help?
@zgouman
@zgouman 2 жыл бұрын
Same problem here. Do you solved it?
@celsoae
@celsoae 2 жыл бұрын
@@zgouman coundnt solve it yet.... i go back to the first gravity system. and im using it.
@zgouman
@zgouman 2 жыл бұрын
@@celsoae I solved it. Idk exactly why but i deleted SetupJumpVariables and HandleGravity in the script and write it again. I think i had a wrong symbol for the math but i dont know which.
@celsoae
@celsoae 2 жыл бұрын
@@zgouman Nice! Illinois try this today
@celsoae
@celsoae 2 жыл бұрын
@@zgouman Same here xD rewrite and is working hahahaha crap xD
@anthonycapron1173
@anthonycapron1173 3 жыл бұрын
Excellent ! thank you very much !!
@ichliebelongboarden
@ichliebelongboarden 8 ай бұрын
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.
@michaelpestanaluis-gamedes3518
@michaelpestanaluis-gamedes3518 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@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
@whoisj
@whoisj Жыл бұрын
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 2 ай бұрын
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.
@jamesreed319
@jamesreed319 3 жыл бұрын
Loving these tutorials, any chance we can get one on adding a camera to the player using cinemachine?
@tomdriver6733
@tomdriver6733 Жыл бұрын
Isn't an Array faster than a Dictioinary?
@hermanator5543
@hermanator5543 3 жыл бұрын
​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 жыл бұрын
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 жыл бұрын
@@iHeartGameDev okay, thanks!
@gowtham27501
@gowtham27501 3 жыл бұрын
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!
@Hiturion
@Hiturion Жыл бұрын
regarding the physics, there is a bit of a confusion between Acceleration and Velocity. But we get your point ;).
@guille_sanchez
@guille_sanchez 2 жыл бұрын
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).
@bryanl7738
@bryanl7738 Жыл бұрын
Came for the video game mechanic tutorial, stayed for the applied calculus lesson
@jroc6745
@jroc6745 3 жыл бұрын
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 жыл бұрын
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!
@mathieuyato9366
@mathieuyato9366 2 жыл бұрын
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 👍
@angelkaki5707
@angelkaki5707 Жыл бұрын
Does anyone have an idea of how to make the 3rd jump stationary n not actually make you move??
@koreanjesus2712
@koreanjesus2712 8 ай бұрын
try disabling "apply root motion" in the animator
@Dudoi
@Dudoi 3 жыл бұрын
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!
@HalcyonVoid
@HalcyonVoid 2 жыл бұрын
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 жыл бұрын
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 Жыл бұрын
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
@mathieuyato9366
@mathieuyato9366 2 жыл бұрын
Hi, wonderful tutorial, I just have one problem it seems like my player jump at the jump height that I have specified when I use the velocity Verlet, do you know why ?
@iHeartGameDev
@iHeartGameDev 2 жыл бұрын
The implementation by the end of this video is not 100% correct. There is a follow up video that might fix your problem
@mathieuyato9366
@mathieuyato9366 2 жыл бұрын
@@iHeartGameDev Hi thanks for the answer, it seems like even after the fix my character still doesn't reach the height desired.
@septimania3483
@septimania3483 3 жыл бұрын
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)?
@tomdriver6733
@tomdriver6733 Жыл бұрын
How to prevent steering during jump and continue after touching ground? Switch off steering and buffer input somehow.
@holdenthompson1449
@holdenthompson1449 3 жыл бұрын
Amazing.
@symmetrythomas7376
@symmetrythomas7376 Жыл бұрын
How would you apply this to knock back force using the character controller and Collision detection?? PLease help
@bovineox1111
@bovineox1111 Ай бұрын
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???
@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?
@hasnain_elahi
@hasnain_elahi 3 жыл бұрын
Mind blowing explanation. Greatest ❤💙❤ .Make a video on Pun 2 multiplayer ❤💙❤
@sufianahmad7337
@sufianahmad7337 3 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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!
@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?
@EnjoyPoPcornYagnik
@EnjoyPoPcornYagnik 3 жыл бұрын
Thanks!
@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
@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?
@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?
@shammahcharles4941
@shammahcharles4941 Жыл бұрын
Can you please make one for melee combat! please!
@digleww
@digleww 3 жыл бұрын
Maybe the next video will be about how to make a combat system?
@kiddynamo66
@kiddynamo66 3 жыл бұрын
Awesome tutorial! Can we do camera controls next?
@shroomik8510
@shroomik8510 3 жыл бұрын
Hi. When I press run and jump the jump is smaller then when I just walk and jump. How fix it?
@samad7228
@samad7228 Жыл бұрын
I need help After writing the code when I enter play mode the character just go up without pressing any button
@fakelaminated5353
@fakelaminated5353 Жыл бұрын
I made the same thing happen by changing the clamp in the else if part of the handlegravity() to a positive number. Setting it back to -20.0f fixed it though.
@NikkuRajpoot-yl3nb
@NikkuRajpoot-yl3nb 6 ай бұрын
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
@DonDisainer
@DonDisainer 2 жыл бұрын
if im using rigidbody is the same but rb.velocity = currentMovement ? thnx for this tutorial!!!
@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?
@emixam2343
@emixam2343 6 ай бұрын
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
@corrput
@corrput Жыл бұрын
is there a reason we don't just do the physics calculations (gravity) in fixedupdate?
@jimmyjakes1823
@jimmyjakes1823 2 күн бұрын
Did anyone else get something like an unrealistic pogo effect if you just hold the jump button down? It seems like the character doesn't fully transition back into an idle stance before jumping again, so that they are just bouncing up and down with their legs in a stationary crouch? I handled this by adding a cool down timer in the script after the jump button is pressed so that jammo goes fully back into his idle stance before he can jump again, but it seems like you should be able to handle this in unity animator with offeset values or something.
@baddie.gamies
@baddie.gamies 2 жыл бұрын
I am pretty sure someone has asked this but why didn't you use the "Any State" for the jump animation?
@iHeartGameDev
@iHeartGameDev 2 жыл бұрын
:) I didn't know how that works tbh
@GhosttheassassinSJ
@GhosttheassassinSJ 3 жыл бұрын
Hey is there a way to change the handleRotation method to rotate with the mouse instead of the WASD keys?
@mikeken7105
@mikeken7105 2 жыл бұрын
Hello, this is a great course. But I have a question. We use velocity verlet, but we don't use v0*t + 1/2*a*t*t in the move method to calculate the displacement, why is that so? Don't we need to use v0*t + 1/2*a*t*t to calculate it? I hope I can get your answer, thank you very much.
@iHeartGameDev
@iHeartGameDev 2 жыл бұрын
Hey Mike! If you follow this tutorial, be sure to check out the follow up to it. I did make a mistake and I fix it in the follow up :)
@mikeken7105
@mikeken7105 2 жыл бұрын
@@iHeartGameDev Okay I understand, I will continue to follow the tutorials, and I really like your tutorials, thank you very much : )
@kingdom216
@kingdom216 3 жыл бұрын
I'm sorry did I miss something, where is the animator? what are the transitions set to? Is it: isJumping true and isJumping false bools? The other tutorial doesn't have a section for jump in the animator. Why is this never working for me? The line of code int zero = 0; wasn't in the last tutorial as a result I am getting one of two error codes one that says: Assets\Standard Assets\Characters\ThirdPersonCharacter\Prefabs\My Scripts\AnimationMotionController.cs(22,9): warning CS0414: The field 'AnimationMotionController.zero' is assigned but its value is never used, and the second error code: 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?) what am I missing please, error happens at 12:40 video mark, I have checked and rechecked and have the exact thing typed as what is in this tutorial.
@andrewknutson8584
@andrewknutson8584 Жыл бұрын
Hey, first off Great tutorials man! I'm having a beginner's error and something in the gravity and grounded bits isn't working. I'm trying to learn coding for games so I can create it from scratch and am trying to not just copy and paste, but I also have an ambitious schedule I got to follow. As Far as I can tell, I've followed the tutorial just fine. My model just seems to not fall off things or goes flying exponentially when jump is pressed. I'm brand new to this, any ideas?
@andrewknutson8584
@andrewknutson8584 Жыл бұрын
Got the fall fixed, but the jump still is crazy.
@andrewknutson8584
@andrewknutson8584 Жыл бұрын
Next Video fixed my problem.
@peegoggles
@peegoggles Жыл бұрын
@@andrewknutson8584 Thank you I had the same problem
@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!
@timarlow8007
@timarlow8007 3 жыл бұрын
This guy is the new Brackeys but better
@iHeartGameDev
@iHeartGameDev 3 жыл бұрын
Thank you for such a kind comparison!
@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
@racoon1461
@racoon1461 3 жыл бұрын
I've done the jump code just as you said but it wont jump. It shows debug... on the console but the character simply wont jump. HELP
@mabit
@mabit 3 жыл бұрын
same issue, mine will jump a faction, turning initial velocity higher only works if I put it into the 1000's
@mowalduchiwa1560
@mowalduchiwa1560 3 жыл бұрын
thank you
@Blueskies2513
@Blueskies2513 2 жыл бұрын
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 жыл бұрын
@@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 жыл бұрын
@@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
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 27 МЛН
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 33 МЛН
Twin Telepathy Challenge!
00:23
Stokes Twins
Рет қаралды 133 МЛН
How to Move Characters In Unity 3D | Character Controllers Explained
9:46
How to jump in Unity (with or without physics)
16:09
Game Dev Beginner
Рет қаралды 48 М.
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,6 МЛН
Improve your Platformer’s Jump (and Wall Jump) | Unity
8:12
Dawnosaur
Рет қаралды 127 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 733 М.
How Jumps Work - Kinematic Character Controller in Unity
7:30
Nick Maltbie
Рет қаралды 12 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,2 МЛН
How to Jump in Unity - Unity3D Fundamentals
10:15
Deniz Simsek
Рет қаралды 145 М.