3RD PERSON CONTROLLER in Unity - JUMPING

Поделиться
HTML-код
  • Опубликовано: 26 янв 2025

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

  • @SamuelPollack-f7j
    @SamuelPollack-f7j 7 месяцев назад +2

    Honestly, even despite me making a completly different kind of third person controller, this helped me make my code modular, converted my code into the new input system, and organized it well. Hats off to you and thanks for the tutorials.

  • @hristoborisov3713
    @hristoborisov3713 3 года назад +12

    SOLVED movement and rotation input while falling after jump
    seems like right after the jump ends and starts falling there is a frame or two where movement and rotation input is registered
    i fixed this by adding an if statement check to the movement and rotation likewise:
    bottom of HandleMovement()
    if (isGrounded && !isJumping)
    {
    Vector3 movementVelocity = moveDirection;
    playerRigidbody.velocity = movementVelocity;
    }
    and bottom of HandleRotation()
    if (isGrounded && !isJumping)
    {
    transform.rotation = playerRotation;
    }
    looks like checking isInteracting isn't enough or my interacting bool isn't working properly

    • @andreistandima
      @andreistandima 3 года назад +2

      You are the best man, thank you so much !!!!

    • @hristoborisov3713
      @hristoborisov3713 3 года назад +2

      @@andreistandima

    • @garybuchert7005
      @garybuchert7005 2 года назад +2

      I am having this issue, but can't get your solution to work for me. In the frames that the animation switches from jump to fall, it reads the input and the player does a "double jump" in the horizontal direction if you are still holding 'W' OR the player just hits an invisible wall and falls if you stop holding 'W' before the frame that switches the animation. Also, if you swivel the camera around before the fall animation begins, it propels you towards the direction you are facing.
      EDIT: I see now! I was simply adding your lines of code, but now I realize that you have placed the already written code into the if statements and that DOES work! Many thanks :)

    • @hristoborisov3713
      @hristoborisov3713 2 года назад +1

      @@garybuchert7005 glad it helped

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

      Even after a year, your comment is helping people out! Thank you so much for this! Exactly what I was looking for

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

    Isn't working as intended for me. When I am jumping there is no height in the jump and after the jump the rotation still doesn't work for me

    • @ljam0786
      @ljam0786 9 месяцев назад +1

      Edit: turns out i just needed to make sure the animation name was correct. It should be "Jump" not anything else

    • @marmar6496
      @marmar6496 8 месяцев назад

      same problem here

  • @hansygaming
    @hansygaming Год назад +8

    SOLVED: For anyone having the weird issue of flying super far forward anytime you are falling/jumping I know the problem:
    In PlayerLocomotion under HandleFallingAndLanding() is the line:
    "playerRigidBody.AddForce(transform.forward * leapingVelocity);"
    And this line will be called every frame that you are falling, so your rigid body will constantly be pushed forward until you are back on the ground. For some reason, my leaping velocity was set to 33, which is why I was flying forward really far, but all you need to do to fix this issue is lower that leaping velocity. I left mine at around 0.25-0.5. This will drastically minimize the amount that you fly forward when you fall/jump. You still want some value on it, as realistically there will be some slight forward movement when you are falling, especially if you fall/jump off a ledge while moving forward.
    Hope this can help someone!

  • @corneliusbuckley8897
    @corneliusbuckley8897 3 года назад +4

    Just need to work in reduced in air control now, thanks for all your work making these!

  • @antcarlus
    @antcarlus 3 года назад +26

    Your effort is honorable..

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

    When i attempt jump it plays the animation but my character barely moves, sometimes doesnt move at all.

  • @paulberry3359
    @paulberry3359 3 года назад +4

    This series is just exemplary! A proper from the ground up tutorial! Thank you so much, subbed! Came here for this, but now going to create new project for the Souls like playlist!

  • @frankkubrick865
    @frankkubrick865 3 года назад +3

    Truly inspiring work! As a beginner, watching your approach to unity and c# is such a huge help, thanks for being an awesome teacher

    • @SebastianGraves
      @SebastianGraves  3 года назад +2

      I am very happy you can learn from my series my friend.

    • @nikhstudiosthe1
      @nikhstudiosthe1 3 года назад

      ​@@SebastianGravesCan you do sliding next please (and if you can)

  • @awefasdfae
    @awefasdfae 2 года назад +3

    I am having an issue despite doing the code correctly. Even if My character jump in place, falling and landing animation occurs, so how do I solve it?

  • @random-gy9uk
    @random-gy9uk Год назад +2

    Hey how can i enable moving while jumping?

  • @Conk3rTh3K1ng
    @Conk3rTh3K1ng 3 года назад +13

    Hello! I've been working alongside the tutorial and have been getting good results! It's been allowing me to experiment and try different things and learn more about coding and I appreciate that as well as your efforts to makes these so easy to understand!
    That being said I have a question if anyone knows. When I press the jump the animation plays but the jumping force isn't applied. I have been following and have re-watched this a couple times but I can't seem to find my error. Any thoughts?
    Edit: I seemed to have gotten closer to my solution. Apparently my issue lies with the " playerRigidbody.velocity = movementVelocity;" in our HandleMovement() function. I think what is happening is that this velocity is being applied mid fixed update. So when I press jump/apply my force in my HandleJump() function it is immediately canceled out by the previous movement function, which has my rigidibody.velocity= movementDirection.y value = 0.
    I'm not sure what the work around to this could be. When I remove the line " playerRigidbody.velocity = movementVelocity;"" my jump works as expected but that completely removes my movement functionality.
    FINAL EDIT: I FIXED IT!
    So i took the line playerRigidbody.velocity = movementVelocity; in the MovementHandler() and added a prerequisite if statement.
    So i ended up with this as the solution:
    if (isGrounded && !isJumping)
    {
    Vector3 movementVelocity = moveDirection;
    playerRigidbody.velocity = movementVelocity; //this is the root of my jumping problem
    }
    This basically takes the rigidybody velocity adjustment and only applies it when the player is both grounded and is not jumping. Haven't ran into any additional bugs and hopefully it stays that way for a bit!

    • @noicenoise8718
      @noicenoise8718 3 года назад +4

      Thanks for this one you gave me the idea where to look. I solved mine differently by just adjusting the x and z velocity, to preserve what ever the y of playerRigidbody regardless of current action. Since the HandleMovement method only concerns x and z movement.
      {in the HandleMovement() method}
      instead of:
      playerRigidbody. velocity = movementVelocity;
      I adjusted it to:
      playerRigidbody.velocity = new Vector3(movementVelocity.x, playerRigidbody.velocity.y, movementVelocity.z);
      This way you can also solve the cancellation of jump input whenever your jumping. So far no bugs yet. Cheers!

    • @corneliusbuckley8897
      @corneliusbuckley8897 3 года назад

      Thanks for posting this! it's giving me some partial fixes for the same problem (:

    • @adarshsahu6724
      @adarshsahu6724 2 года назад

      Thank you for your help. Really appreciate it :)

    • @clashzz7875
      @clashzz7875 2 года назад

      @@noicenoise8718 legend thank you

    • @draicor
      @draicor 2 года назад

      I fixed it differently, I don't know if someone will prefer it this way, but I think it feels more realistic, since I was having a bug where I could change the direction the player was going to mid air when the falling anim started playing.
      What I did was:
      1) At the start of the HandleMovement() I have an if that checks if (isJumping || !isGrounded) return, to avoid moving the player while jumping or falling.
      2) Also, on the HandleJumping() I have after the jumpingVelocity definition:
      movementVelocity.y = jumpingVelocity;
      playerRigidbody.velocity = movementVelocity;
      This works wonders, now the momentum the player had before jumping or falling feels a lot more natural.

  • @garybuchert7005
    @garybuchert7005 2 года назад +2

    Thank you for your time and effort to help others!

  • @david100awesome
    @david100awesome 2 года назад +6

    For anyone struggling with not being able to move forward while jumping, try unchecking apply root motion on the animator.

  • @Kiki_Cl
    @Kiki_Cl 2 года назад +2

    Hi Sebastion, I love you video I think you're doing great.
    But I have one question, if I wanted to make it so my momentum isn't locked when I jump what would I have to do?

  • @SpikeCooks
    @SpikeCooks 3 года назад +4

    heyo, ive really been enjoying these tutorials but I feel super stupid atm, and cant figure out how to let the player jump and move at the same time, unlike yours where you lock the movement while jumping, could you lend a hand at all ?

  • @_SF_Media
    @_SF_Media 3 года назад +1

    As always, magnificent work. Looking forward to the next video.

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

    Just a reminder to ensure that the animations you use all end in the same position. I had a landing animation that made the model land in a negative y position, causing some weird clipping. I'm sure there's a way to fix it but i replaced my animation and that issue went away.

  • @superanretanek
    @superanretanek 2 года назад +1

    for future, you can tell everyone that tones of animations are on Mixamo from Adobe and all are for free use for everything ! :D

  • @shazboi
    @shazboi 2 года назад +3

    [SOLVED] 11:26 my character doesnt go forward when I press the "Up key"
    just uncheck "Apply root motion" in the animator.. fkin took me 2 days of sleep and procrastination to arrive at this somehow but ye it works

    • @shazboi
      @shazboi 2 года назад +1

      @William Coleman in the animator component

    • @henkiespenkie4414
      @henkiespenkie4414 2 года назад

      @@shazboi hi man, could you add your files to github or something? My character just does not jump whatever i try

    • @shazboi
      @shazboi 2 года назад

      @@henkiespenkie4414 Hey man I am sorry for the really late reply, yeah I kinda have more bugs in the jumping thing soooo even my code isn't correct ig

    • @draicor
      @draicor 2 года назад +3

      @@shazboi Its on the inspector while having the LowPolyMan object selected.. on the animator component inside the low poly man :v

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

      @@draicor omg, that solved my falling and jumping forward velocity when the w key is hit! Before it did nothing to the forward velocity.

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

    I know this is a long time since this videos upload, but I have been following the dark souls tutorials, I saw this video and wanted to implement this version of jumping. However once I implemented it my player does not move up or down, the animation plays but nothing else. How can I fix this problem.

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

      I know its been a while but any chance you figured this out?

  • @Andre_Sargeant
    @Andre_Sargeant 3 года назад +4

    Nice video! This 3rd person series seems to be using better systems than the dark souls series for some things which makes it desirable to refactor to but the more I do that the less compatible it becomes with the old system especially if we need those dependencies for later mechanics. As both series progress is the plan to update the souls series to work in tandem with this series or will the structure deviate more to the point these should be used more abstractly or as separate projects?

    • @SebastianGraves
      @SebastianGraves  3 года назад +5

      I wouldn't say the systems used here are "better". They are just more simplistic in design, and that allows for a much easier understanding!
      I am sure some features of the Souls series will see a refactor, however in the end the systems used on that series will differ very much from these. The only cross over would be the basic locomotion and Input systems.
      Cheers! :^)

  • @josephdestrampe3317
    @josephdestrampe3317 3 года назад +4

    I really appreciate the effort with this series. There are so many out there that just seem to twist off into frustration. I am experiencing a slight issue. When I jump, which is working great, the forward momentum isn't applied. I can be sprinting and hit jump and the character jumps straight up. All forward momentum stops. Same when I run off of an elevation. No forward momentum whatsoever. It's odd. Everything else seems to work like gangbusters. If anyone can shed some light, that would be super.

    • @klevialushi571
      @klevialushi571 2 года назад +5

      I was literally having a couple of issues, just to find in here by a random comment that i had to untick apply root motion, i know that you posted your comment a year ago but someone else might run into similar issues like i had. So to fix this just go in your Animator component and uncheck Apply root motion and that's basically it.

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

      You were right. Thank youu ^^@@klevialushi571

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

    could this TPS controller be use for commercial use?

  • @tcgvubiii
    @tcgvubiii 3 года назад +2

    what edits and adjustments can i make to the script to have the character be able to move direction mid air? it feels clunky when im only being able to move 1 direction. Thanks :)

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

      Did you ever find the answer out to this?

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

      @@ShinStoopkid When you call the falling animation, pass false into PlayTargetAnimation and your usual movement logic should work fine. At the moment the 'IsInteracting' bool is preventing that logic from firing

  • @SM-jb8cj
    @SM-jb8cj 3 года назад +3

    Hey Sebastian. First off you are an amazing teacher. I am learning so much and its also incredibly fun. So thank you for that! Second I was wondering if this series will eventually cover combat, AI, Stats, Items, etc. I started with your Dark Souls tutorials and quickly found I was not able to keep up but then I found this. The slower pace is just what I needed.
    Thanks again for all your hard work and for making learning this stuff fun and accessible:)
    ps. As soon as I have stable income I'll be throwing my money at you on patreon lol.

    • @SebastianGraves
      @SebastianGraves  3 года назад +3

      I am very happy you are learning something from my content my friend :^)
      This series will unfortunately not cover any of these mentioned items, as I plan on doing other tutorials that will include those selections. (The Souls series already has most of that)

    • @SM-jb8cj
      @SM-jb8cj 3 года назад +1

      @@SebastianGraves Dope! You're the best and I'm stoked to graduate to the Souls series when I get there!

  • @Rjf32
    @Rjf32 3 года назад +3

    Only 18 hours can’t wait

  • @raymondoh
    @raymondoh Месяц назад

    Thanks for the great tutorial! I made a super jump and played Morpheus jumping for ten minutes😆

  • @ContradictingOG
    @ContradictingOG 2 года назад +3

    Hey I'm aware this is an older video and you might not see this, but I started taking Unity courses a couple months ago and felt like I was getting nowhere until I started watching your videos. I feel like I'm learning much better and at a faster rate. I've only had 1 issue with Unity that I have no idea how to solve which is:
    (When I have my animation states (jump, falling, land) I'm only able to run 1 single transition from them. So I can't run the the transition from jump to empty to run the check to see if the character isGrounded or not to revert to default animations) again thanks so much for these videos!

    • @lvcifergaming7231
      @lvcifergaming7231 2 года назад +1

      Hey :) this is an update issue, i'm pretty sure your unity is in version 2020.3.32f1 you must update it to 2020.3.33f1 (the lastest version today) doing the update will allow you to create many transitions from one action.

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

    My character barely move to jump... how do I fix this?

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

    Two years old video and still extremely helphul! Thank you so much.
    Still, i have a problem :D my boy( player character) jumps only in place and dous not keep the forward velocity.Might be a animations setting problem. Do you have any suggestion that would sove the problem?

  • @Szogun_
    @Szogun_ 5 месяцев назад

    when i press jump button then player jump but animation have little delay. when player is mid air then animation is playing. help me fix

  • @nibsnaf
    @nibsnaf 3 года назад +1

    anyway to make the jump less floaty?

  • @williamzhang7075
    @williamzhang7075 3 года назад +1

    Dose any know why my character could stay in Jumping condition? If I jump once, it will be lock in a strange condition. And no Error information...

  • @joshxd6680
    @joshxd6680 2 года назад +1

    I wanna know if anybody else is having this same problem and especially if they know how to fix it but my isInteracting and isJumping bools don't reset and I have no idea how to fix it

  • @RaebEeffoc
    @RaebEeffoc 3 года назад +4

    (Making new comment for better visibility)
    Below I asked the question on how to solve the problem of the character gently gliding down slopes (not enough height to begin falling). This issue seems to be more prevalent when trying to go down a set of stairs at say 25 degrees. The character will start falling down the stairs instead of running down them normally.
    I came up with a solution, but I’m sure Sebastian could come up with something far more elegant and efficient. However, in case other people are interested, I came up with the following solution by raycasting to the ground and seeing if the angle exceeds a certain threshold. Then apply a downward force.
    private bool CheckForSlope()
    {
    if (isJumping)
    {
    return false;
    }
    RaycastHit hit;
    if (Physics.Raycast(transform.position, Vector3.down, out hit, GetComponent().height * slopeForceRayLength))
    {

    // If the hit does not return a Vector 3 of 0.1.0 then we know its on a slope.
    if (hit.normal != Vector3.up)
    {
    // Now to get the angle of the slope. If its less than say -10 degrees then we are going down a slope. (-10 to 0 is still a downward
    // slope but not enough that I would want to apply a full downward force on the player.
    float slopeAngle = Vector3.Angle(hit.normal, transform.forward) - 90;

    if (slopeAngle < slopeAngleThreshold)
    {
    return true;
    }
    }
    }
    return false;
    }
    Then in the HandleMovement method, just after applying velocity to the rigidbody, add the following:
    // Check to see if we need to apply downward force if moving along a slope.
    if ((inputManager.horizontalInput != 0.0f || inputManager.verticalInput != 0.0f) && CheckForSlope())
    {
    rigidBody.AddForce(Vector3.down * downwardForce);
    }
    Finally, additional variables to be added at the top:
    [Header("Slope")]
    public float downwardForce = 120; // Experiment with values while going down slopes.
    public float slopeForceRayLength = -1.5;
    public float slopeAngleThreshold = 10.0f; // The angle that the slope needs to exceed before downward force is applied.
    I hope this is of some help to people.

  • @adrianperez528
    @adrianperez528 3 года назад +1

    Thanks very much for this couse, its great to learn new Input system and all about third person controller.

  • @darkstarmike85
    @darkstarmike85 3 года назад +2

    Thanks again for all your work. Are there any specific paid animation assets you'd feel comfortable recommending?

  • @lvcifergaming7231
    @lvcifergaming7231 2 года назад +1

    Hey, :) for those who can't create many transitions from an action you must update your unity to 2020.3.33f1 (the lastest version today) to fix this.
    it's an update issue from the previous version 2020.3.32f1.

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

    Anyone having the issue where you barely move on a jump (even if you hold down move/sprint key) click the player (gameobject) and look at the Animator in the Inspector Window and make sure Apply Root Motion is unchecked.

  • @drugnetlv
    @drugnetlv 3 года назад +3

    Great video, love the series. I know this is going to be a long shot, but worth a try. Got everything working following step by step except the forward movement during the jump. My player does not move forward, just goes up and down, even if I hold forward input. Any ideas?

    • @charanjeetsaluja1515
      @charanjeetsaluja1515 3 года назад

      :)

    • @hristoborisov3713
      @hristoborisov3713 3 года назад

      not really, could be the booleans arent setup properly, best advice is to rewatch and look for mistakes you've made

    • @fabse404
      @fabse404 3 года назад

      I have the same issue, did you find a solution yet?
      seems like the Rigidbody does not takes the movement and just the y axis from the jump
      but i have no Idea how to fix it

    • @stiendeveltere9351
      @stiendeveltere9351 3 года назад

      same here

  • @user-ow8sk9bo6e
    @user-ow8sk9bo6e 4 месяца назад

    For anyone having issues with not being able to move forward while jumping or falling uncheck 'Apply Root Motion'.

  • @davidikus29
    @davidikus29 3 года назад +2

    I have a bug with that design. if u press jump and then try to move, you can see that person change movement direction in air

    • @garybuchert7005
      @garybuchert7005 2 года назад

      Same, trying to solve this as well. Did you have any luck implementing a fix?

    • @indraotsusukii8039
      @indraotsusukii8039 2 года назад +1

      @@garybuchert7005 Did you have any luck implementing a fix?

    • @garybuchert7005
      @garybuchert7005 2 года назад

      @@indraotsusukii8039 Hey! I believe the movement in air after jumping was solved by adding
      if (isJumping) return;
      to the top of HandleMovement() on the PlayerLocomotion script. This is shorthand. I also added this to my HandleRotation() and HandleRoll() functions so that the player isn't able to apply any movement, rotation, or roll while the isJumping bool is set to true.
      Does that help?

  • @jwlewis777
    @jwlewis777 4 месяца назад

    Very nice tutorial! Thank you!
    1 issue I found is when your running and run into a cube then hit jump, the player will get stuck in isGrounded and isJumping. They wont move or jump after that. You have to stop moving, then manually uncheck isGrounded in the inspector for the player character to reset.
    I added
    animatorManager.animator.SetBool("isGrounded", false); //added due to getting stuck when jumping around blocks
    isGrounded = false;
    to the bottom of the PlayerLocomotion, HandleJumping() function and it seems to have fixed it, but there may be a better way.

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

    Alright my only problem is that if I jump on a slope facing downwards, then my player goes shooting straight slidin off in the distance. How can i stop that?

    • @KiritJain-ww4zk
      @KiritJain-ww4zk 10 месяцев назад

      If you have the find the solution for this problem then please share it with me

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

    If anyone is having an issue where they have no forward momentum while jumping (jumping straight up in the air) try turning off root motion in the players animator component.
    I dont know if this makes a difference but I also changed HandleJumping() in the PlayerLocomotion script to look like this:
    public void HandleJumping()
    {
    if (isGrounded)
    {
    animatorManager.animator.SetBool("isJumping", true);
    animatorManager.PlayTargetAnimation("Jump", false);
    float jumpingVelocity = Mathf.Sqrt(-2 * gravityIntensity * jumpHeight);
    // Preserve the current horizontal velocity and apply jump velocity to the y-component
    Vector3 playerVelocity = playerRigidbody.velocity;
    playerVelocity.y = jumpingVelocity;
    playerRigidbody.velocity = playerVelocity;
    }
    }

  • @adamaze2920
    @adamaze2920 3 года назад +1

    even the paid asset templates have bad jump mechanic... this is excellent...

  • @epicdoggames9667
    @epicdoggames9667 3 года назад +1

    Another brilliant tutorial Sebastian!!! I truly appreciate the work you are putting into these lessons and finding different ways to accomplish tasks that you did in the Dark Souls series. I like your implementation of falling, landing and jumping in this series better than the Dark Souls series. My only complaint is I have to wait 3 more weeks before the next video. 😪

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

    everything works so far, but after jump input, after it lands, it shows isGrounded = true; and keeps isJumping = true;
    it doesnt change isJumping to false after it lands. what can be issue? i cant figure out what overrides it in animator to keep it true?

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

      nevermind after 3 hours i figured that ResetIsJumping script isn't attached to jump animation in animator... *facepalm*

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

    I keep having problems with the jump system, where I can jump multiple times, even in the air.
    Does anyone know how to fix this, to make me jump only once when I touch the ground?

  • @shayaanhussain6056
    @shayaanhussain6056 3 года назад +1

    My character always seems to be about 0.2 of the ground
    enjoying the vids

  • @petermoss7387
    @petermoss7387 2 года назад +1

    theres a moment between jumping and falling where my controller can effect the direction so im tryina figure that out and will recomment with solution if no ones got one

    • @garybuchert7005
      @garybuchert7005 2 года назад

      I see this as well, but no luck finding a solution yet. @Hristo Borisov seemed to implement a fix in their game, but it didn't work for me. Did you have any luck?
      EDIT: Take a look at @Hristo Borisov comment. They added if statements to the HandleMovement() and HandleRotation() functions and this worked for me. Just need to tweak some other variables to make it look a little smoother now.

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

    HEllo, not sure if anyone can help but after jumping i can no long more on the XZ axis, I just run in place. Im not sure what is happening. I have root motion unchecked as well but this has not resolved the issue. before jumping he is able to run but after jumping he cannot.

  • @茆心语
    @茆心语 2 года назад +1

    Can anyone help me please? Everytime I press the space botton, my character just fly into the sky and never fall. Why would that happen?

  • @epicdoggames9667
    @epicdoggames9667 3 года назад

    Any hint on when and what the next episode will be about?

  • @imconfused6955
    @imconfused6955 3 года назад +8

    Hello, Great tutorial, but I've run into an issue. Whenever I jump, my player's x and z velocity are completely canceled. I've used debug.log and the values are still there, but for some reason, they are not being applied to playerRigidbody.velocity. Is this a known issue?

    • @imconfused6955
      @imconfused6955 3 года назад +7

      Nevermind, I got it. The solution was to uncheck "apply Root Motion on the animator." A very simple fix, easily overlooked.

    • @JLee118
      @JLee118 3 года назад +3

      Thanks man this was really helpful

    • @mobbarley1112
      @mobbarley1112 3 года назад

      lol, thanks UwU

    • @Akovor_
      @Akovor_ 2 года назад +2

      @@imconfused6955 This helped with my issue slightly! I'm having a similar problem where after jumping I only move in a straight line. Unchecking apply root motion makes it so my character just runs on the spot

    • @kaisinelmusic
      @kaisinelmusic 2 года назад

      @@Akovor_ did you get it to work? im having the same issue...

  • @JuffeGuffe
    @JuffeGuffe 3 года назад +1

    awesome tutorial, hoping you gonna implement more features in the future!

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

    Hi, thanks for the tutorials! I'm havnig a problem. My character is playing the jump animation, the velocity is increasing on the y axis, but the character is not moving. Just standing in place and playing the jump animation 😰

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

      UPDATE: Those having this issue it is caused by the "if(isJumping) return" not being present in the HandleMovement() method. Add that back in and you're golden.

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

    Can you add sprint jumping

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

    I appreciate the tutorials, but it would be nice if a bit more planning was going into the engineering, as you seem to be using a philosophy of "if I need something I will make it public", which is really bad practice.

  • @rakshitranjan8040
    @rakshitranjan8040 3 года назад +2

    pls continue this series

  • @prophy6680
    @prophy6680 3 года назад

    Is getter/setter and serializedfield good for unity? My eyes is bleeding from seeing to many public field lol

  • @marmar6496
    @marmar6496 8 месяцев назад

    My character doesn't move vertically when I jump, the animation works, but it doesn't go up, anyone can help?

    • @marmar6496
      @marmar6496 8 месяцев назад

      the movement flag of is jumping doesn't get checked when I click on the jump button

  • @makeitbetterchallenge
    @makeitbetterchallenge 2 года назад

    Can pls someone help me? I have Root Motion unchecked, I rewatched the video a coupl3 of times but and the code is right. So my problem is, when I jump, the character moves forward. Maybe I am dumb but I did not find solution reading the comments.

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

    When I jump the player jumps pretty high, and he keeps jumping

  • @RaebEeffoc
    @RaebEeffoc 3 года назад +1

    Very good tutorial so far. Great job. My hope is that you continue the series. Something I have noticed and I'm hoping it's not me not setting this up correctly. I placed a set of stairs in my scene. Going up doesn't seem to have any issues. Going down however. If I walk, the character doesn't walk down the slope, but rather sort of hovers and then gradually lowers down to the slope. If I run, then the character sort of lauches herself forward and falls down the stairs. Even lowering the leapVelocity doesn't seem to stop this. I suspect this has something to do with moveDirection.y = 0.0f interfering with gravity letting the character naturally walk downwards. Anyway, thanks alot for everything so far. It's been very helpful.

    • @SebastianGraves
      @SebastianGraves  3 года назад +8

      I can do a video on stairs and slopes if you'd like :^)

    • @RaebEeffoc
      @RaebEeffoc 3 года назад

      @@SebastianGraves That would be greatly appreciated. I've been trying to do a workaround but haven't been able to quite nail it. I'm sure others would benefit if you have a solution. Many thanks.

    • @Fatmandu
      @Fatmandu 3 года назад

      @@SebastianGraves I put ramps in my scene and would like to see how you handle making the player stick to stairs/ramps.

    • @klemsoy
      @klemsoy 3 года назад

      @@SebastianGraves Yes please, I've been itching to ask that. Btw thanks so much for your lessons :>

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

    Is there any way at all to allow movement during the falling/jumping?
    EDIT: I figured it out - it's not perfect, rotation/movement is a little snappy, but the solution has no noticeable problems so far. To allow movement being enabled you just have to remove the !isGrounded checks at the bottom of HandleMovement(); and HandleRotation();.
    Then, in the HandleAllMovement();, just duplicate HandleMovement(); and HandleRotation();, but put it inside of an isInteracting if statement. Make another if statement inside and check for !isGrounded, and use else to return if isGrounded.
    This should, in theory (and from the results I've received), separate movement between Jumping and normal movement, but both of them still utilizing the same functionality at the same time. Best of both worlds. Hope this helps someone.

    • @t.a2501
      @t.a2501 10 месяцев назад

      thank you your share. But you mean is this function right ?
      public void HandleAllMovement()
      {
      HandFallingAndLanding();
      HandleMovement();
      //to be countinues.....
      if (playerManager.isInteracting)
      {
      if (!isGround)
      {
      HandleRotation();
      HandleMovement();
      }
      else
      {
      return;
      }
      }
      //if (isJumping)
      //return;
      HandleRotation();
      }

  • @Chris-jy2qe
    @Chris-jy2qe 2 года назад

    It works well, but when I want to allow movement in the air, I commented HandleMovement() condition,
    /*
    if (isJumping)
    return;
    */
    then the player can't jump, any ideas?

  • @AaronAsherRandall
    @AaronAsherRandall 3 года назад

    Hi there, I love these tutorials!
    I am having an issue where my player is getting stuck in the "Faling" state and animation. Any idea what might be causing this?

    • @SebastianGraves
      @SebastianGraves  3 года назад

      Is your ground check resetting? :^)

    • @AaronAsherRandall
      @AaronAsherRandall 3 года назад

      @@SebastianGraves Hi Sebastian. I got it all working with the logic system attached for the animator. Is this set up correctly? Yes, the isGrounded is now resetting in the animator:
      drive.google.com/file/d/1p3Fm2efroj3eAqg_kx1WMGqz4TJVwC9S/view?usp=sharing

    • @mknightdev
      @mknightdev 3 года назад

      ​@@AaronAsherRandall I don't have the 'isInteracting' condition between 'Land' and 'Empty' and mine is working, so maybe it's that?

  • @roberthenderson9175
    @roberthenderson9175 2 года назад

    I keep getting an error message of null reference exception: object reference not set to an instance of an object. This is on the input handler HandleJumpInput, playerLocomotion.HandleJumping();

    • @zahdoma
      @zahdoma 2 года назад

      same here did you find a fix?

    • @zahdoma
      @zahdoma 2 года назад +1

      figured it out, add playerLocomotion = GetComponent(); to your input manager in the Awake method

  • @olqb9532
    @olqb9532 3 года назад

    I have a bug and for the life of me I can't figure out how to fix it. As soon as I hit play, the character jumps once without any input, comes down but doesn't touch the ground. It's stuck in the falling animation, hovering the ground. isInteracting doesn't get reset since the character doesnt hit empty state, so I can't do anything. If I manually set it in play mode the character instantly jumps again. I have no idea why the charater jumps on his own, since playerControls define spacebar as input.

    • @olqb9532
      @olqb9532 3 года назад

      @@strucep Mh, I already had that. What fixed it for me was adding the jump bool the HandleJumping() and in HandleJumpInput() changing the order of the statements, so the bool is set to false after the method has been called. But now the jump is a bit wanky. Seems to lose forward velocity pretty fast as soon as the character is in the air. When the falling animation plays he just falls down without any forward movement.

  • @waynedaley6079
    @waynedaley6079 2 года назад

    Just finished going thru this tutorial... something strange though ... when I hit play my character immediately starts jumping without pressing any key ...falls a bit not to ground and jumps again in mid air ... this cycle keeps happening as the character gets higher and higher .... can anyone point me in the right direction to start debugging it?

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

      I am unsure if you managed to fix this problem but if you go to your animation in the in your animation folder then click on the original you should be able to turn it into a humanized animation. Once done copy it by clicking Ctrl+D then click on the copy one and tick loop time, and bake into pose :)

  • @LoriatGaming
    @LoriatGaming 3 года назад +1

    Great tutorial as always, please do rolling action at the same button as run on the next one please! i beg on you!!!

    • @kyleme9697
      @kyleme9697 3 года назад +1

      I think there's a bunch of videos on rolling actions in his Redo Dark Souls series, and if I recall correctly there was one on that very thing.

  • @helloimvic7451
    @helloimvic7451 3 года назад

    enjoy your videos, it really help me alot. thank you

  • @tsotnemuzashvili7009
    @tsotnemuzashvili7009 2 года назад

    it doesnot go forwar when iam jumping can someone help me?

  • @AssassinateThisEzio
    @AssassinateThisEzio 3 года назад

    My player is just stuck with isInteracting and it is causing me to stay in the falling animation. I have rewatched the last few videos several times.

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

    Managing variables from animations is a bad idea that will bite you sooner or later. At least use triggers that will update variable in a class.
    Also, store strings for animation names in one place as public static string and refer only to these static, do not use raw strings in your code!

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

    Does anyone have an issue with the character sliding around after they land

    • @KiritJain-ww4zk
      @KiritJain-ww4zk 10 месяцев назад

      I am having the same issue did you find any solutions?? Please share it with me if you hav

  • @therealmaxplaysgames69
    @therealmaxplaysgames69 3 года назад

    i've made the animator public but it's not working

  • @vugsey
    @vugsey 3 года назад

    An excellent tutorial! Just one thing is not going so smoothly which is the transition into the falling animation - it takes a second for it to go from falling to landing. I'm just wondering if anyone else has encountered this problem and knows how to fix it.

    • @SebastianGraves
      @SebastianGraves  3 года назад +4

      Uncheck "Has Exit Time" on the animator transition :^)

  • @inklantern1687
    @inklantern1687 2 года назад

    Hello! The tutorial is good and I was able to get it to work but there were some issues with unity going between computers and now I’m experiencing some problems.
    The jumping is for the most part working fine but I am no longer able to move normally, and isInteracting is constantly on unless its playing the jumping animation. Does anyone know how to fix this? Ive gone through this and the previous video and havent been able to find a way

    • @inklantern1687
      @inklantern1687 2 года назад

      I was able to fix it! The only issue was that one of the animation transitions didn’t have a condition

    • @CanalGenericojsjs
      @CanalGenericojsjs 2 года назад

      @@inklantern1687 how did yo fix?

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

    when does isJumping become false again??

  • @Sorta_Maybe
    @Sorta_Maybe 3 года назад

    I'm following your tutorials and I love them! Could you do something on gliding?

  • @garybuchert7005
    @garybuchert7005 2 года назад

    Could anyone possibly answer why my falling animation is adding a small amount of upward velocity to my player? Anyone ever run into this?

    • @SebastianGraves
      @SebastianGraves  2 года назад +2

      Does your animation have upward root motion by any chance? If so, are you enabling root motion during the falling animation? You can check this using Debug.log :^)

    • @garybuchert7005
      @garybuchert7005 2 года назад

      @@SebastianGraves Thank you for taking the time to reply! It seems all of my animation clips say "Root contains root motion curves" Is that what you're referring to? If I reimport the animations and change to None on the root motion, I see the option to adjust the Root Transform Position (Y), but I can't seem to find a combination that makes it look and feel any better.
      I'm honestly not sure how I'd go about using Debug.Log to tell if it's being enabled or not. Working on that now though and I will report back.

    • @SebastianGraves
      @SebastianGraves  2 года назад +2

      @@garybuchert7005 Hey Gary!
      Root motion essentially moves the character with the animations movements, instead of moving it with code. For jumping and falling in this project we do not want this.
      You can use an animation that uses root motion, but disable the root motion via script.
      You can check if your animator is using root motion, by referencing the animator variable like this!
      Debug.Log(animator.applyRootMotion);
      If the console says "True". You are using Root Motion. If it says "False". You are not!
      If you are not using root motion, but you are still getting some movement oddities, check for odd collisions between colliders or perhaps a mistake in the code.
      Good luck my friend :^)

    • @garybuchert7005
      @garybuchert7005 2 года назад

      ​@@SebastianGraves Hmm strange. The console is telling me "False". I've reimported the jump, fall, and land animations and updated Root Motion Node to on the FBX file before duplicating the animation clips. There is still a very slight upward boost when transitioning from jump to fall, but I'm also now noticing that my jump is moving the player forward without me holding 'W' which tells me that root motion is still enabled somehow?
      Think I'm going to call it for the day and come back tomorrow with fresh eyes. Thank you again for taking a look with me!

    • @garybuchert7005
      @garybuchert7005 2 года назад

      @@SebastianGraves Yea, has to be in the code or collisions because I removed the animation and the little boost still seems to be there. Thanks again for pointing me in the right direction!

  • @Rjf32
    @Rjf32 3 года назад +1

    Yayyyyy love these vids

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

    PLEEEAAAASE... Make a tutorial on VAULT and CLIMBING system with your 3rd person controller... I tried to ajust others tutorials on climbing and vaulting with this one and it doesn't work... I'm dying bro... Please do something...

  • @nikhstudiosthe1
    @nikhstudiosthe1 3 года назад

    Can you do sliding next please (and if you can)

  • @DR-un9xw
    @DR-un9xw 3 года назад +1

    hey thank you for the series :)
    so,
    i don't know if i should ask this or not but can you tell how to switch players like in lost ember
    like i want to have a main character say ((X )) but want that to possess different other temporary characters = Y,Z,A ,etc.
    and when i return i want the main character to reappear.
    i am a beginner and have absolutely no idea what is going on with my project
    so any help is greatly appreciated .

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

    A comment for the god of comments

  • @muhammadjonyangiboyev951
    @muhammadjonyangiboyev951 Месяц назад

    thanks a lot

  • @sufyaanali
    @sufyaanali 3 года назад

    SEE YOU ON THE WINNERS SIDE!! ♥

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

    The player only jumps in place

  • @woong2335
    @woong2335 3 года назад

    plz add slope system

  • @ace-dk7yf
    @ace-dk7yf 3 года назад +1

    Thanks a lot this is my first time doing coding but it all worked out good but I want to tweak it so that i can move while jumping and so that the movement and rotation is not restricted.

  • @DonDisainer
    @DonDisainer 3 года назад

    thnx for this!!!

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

    This is to please Algorithm Gods.

  • @0NEFREEMAN
    @0NEFREEMAN 3 года назад

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

    Het so I followed this seires and I'm having a problem to where my character only jumps when not grounded. Anyone know how to fix that?

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

    Hey i know this tutorial is old but i have done literally everything in this video and i can't jump, my isJumping is ticking but jump_input isn't ticking and my character isn't jumping at all, my characterRigibody.velocity isn't doing anything, does anyone know any fix?