FIRST PERSON MOVEMENT in 10 MINUTES - Unity Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น •

  • @Hietakissa
    @Hietakissa 2 ปีที่แล้ว +439

    for anyone struggling with the player sticking to walls; Make a Physic Material with little to no dynamic friction (I used a value of 0.1 with Friction Combine at Minimum) and assign it to the player's Collider. You can experiment with different friction values to find what works best for your game

    • @mlgjman1837
      @mlgjman1837 2 ปีที่แล้ว

      for me I needed to apply it to the slopes as well

    • @Hietakissa
      @Hietakissa 2 ปีที่แล้ว +2

      @@mlgjman1837 how do you mean? If you set the Friction Combine to minimum it will use the smaller value of the 2 colliding objects, so it should be enough to just apply it to the player directly.
      Unless you are talking about some other problem.

    • @Carl-Randomness
      @Carl-Randomness 2 ปีที่แล้ว +13

      Am i too dumb to understand this

    • @Hietakissa
      @Hietakissa 2 ปีที่แล้ว +3

      @@Carl-Randomness the player is sticking to the walls because of friction, the friction is too high for the player to keep their momentum so they get stuck.
      By making the player have less friction they can slide across the wall

    • @Carl-Randomness
      @Carl-Randomness 2 ปีที่แล้ว +3

      @@Hietakissa Oh thanks

  • @pikapikalis
    @pikapikalis 2 ปีที่แล้ว +1555

    This tutorial was great but one small problem. I couldn't get the capsule to jump until I compared my script side by side with your script and noticed that in the video you do not say to add the following line to Start()
    readyToJump = true;
    You might consider updating your description so people know. I spent awhile trying to figure it out comparing everything I did from the video before I gave up and looked at your script.
    edit: this was a year ago, still getting thanks to this day. never expected to get this much support, thank you all for the 1k likes. means alot. good luck on your movement systems everyone!

    • @mentallyunprepared8635
      @mentallyunprepared8635 2 ปีที่แล้ว +30

      yeah I noticed it too and was so confused, why it didn't jump, thanks for the heads up

    • @aidanhawley3981
      @aidanhawley3981 2 ปีที่แล้ว +20

      You helped me alot thank you.😘

    • @whitehook5450
      @whitehook5450 2 ปีที่แล้ว +19

      Hey, I added this, but I still cannot get the capsule to Jump, even tried with the movement script in the description, still doesn't work, do you have any solutions? Everything else works just fine.

    • @dadenbenoit3159
      @dadenbenoit3159 2 ปีที่แล้ว +2

      Had the same issue. But great tutorial!

    • @pikapikalis
      @pikapikalis 2 ปีที่แล้ว +2

      @@whitehook5450 do you have your ground layer set to, "whatIsGround"?

  • @Alejandro_Berra
    @Alejandro_Berra ปีที่แล้ว +13

    I was doing my own FPS controller without any guidance and everything was alright but some weird camera jitter so I decided to check how everyone was tackling the camera. I never thought of having it outside the hierarchy of the player. Now I have 0 problems amazing idea!

  • @jehriko7525
    @jehriko7525 ปีที่แล้ว +40

    Thanks a bunch! For someone like me who's absolutely new to programming in unity I'm appreciative that this is low-level enough for me to able to understand why each piece of code is being inputted.

    • @Kwakky69
      @Kwakky69 ปีที่แล้ว +2

      i dont even know how to make a script for the cam

    • @Sushanththeartist
      @Sushanththeartist 7 หลายเดือนก่อน +1

      @@Kwakky69 i dont even know where to put the script

  • @Inferim
    @Inferim 9 หลายเดือนก่อน +11

    Your methods are so simple! I've ran into multiple problems with syncing the camera with an object that has a character controller before. Similarly, I had to do mental gymnastics just to figure out how to move the player based on the camera's perspective. Having an object whose only function is to keep track of orientation saves a lot of mental work and is definitely a game changer. I need to think like that more! Glad to have found this tutorial. Great stuff man!

    • @dnrspdr03canadian95
      @dnrspdr03canadian95 6 หลายเดือนก่อน

      i gotta ask, i for some reason have copied the exact code and my character doesn't move, im rather new to this and just started learning today, is there something im missing thats just common sense?

  • @libbycb
    @libbycb 11 หลายเดือนก่อน +34

    thanks for the tutorial!!
    if yall can't jump you can put "readyToJump = true;" in Start() or just when you create the variable initialise it to true ("bool readyToJump = true;").
    if ur jumps are huge and fall slowly, i found that increasing the rigidbody's mass in Unity helped, I liked 1.6 but tweak it for yourself. also tweak the jumpForce, i'm at 10.

    • @igoraugun1471
      @igoraugun1471 7 หลายเดือนก่อน +4

      Man, you just fixed my problem which I've been struggling with for 2 hours, tysm

    • @yuko_xzx
      @yuko_xzx 5 หลายเดือนก่อน

      i have the same problem but i dont get what your saying can you give me help there was 2 ready to jump = the first one was false and the second was true i changed the first one to true nothing happened i tried copy pasting ("bool readyToJump = true;") under but there was an error so i deleted it

    • @aritrabose8h852
      @aritrabose8h852 5 หลายเดือนก่อน

      @@yuko_xzx go to your Start() function. See where you can find the any code with the following words "void Start". Then inside the curly braces, write " readyToJump = true; " hopefully that helps.

    • @HelwaHalloum
      @HelwaHalloum หลายเดือนก่อน

      god bless

    • @pulsetrollge
      @pulsetrollge หลายเดือนก่อน

      You just saved my life❤

  • @thxr9766
    @thxr9766 2 ปีที่แล้ว +146

    if you have a problem with the ground check then just add an empty game object at the bottom of the player then write this:
    grounded = Physics.CheckSphere(groundCheck.position, groundDistance, whatIsGround);
    with these as variables:
    public Transform groundCheck;
    public float groundDistance = 0.4f;
    public LayerMask whatIsGround;
    bool grounded;
    i got this from brackey's fps tutorial btw and it seems to work nicely with this script.

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +23

      Yeah that works just fine, thanks for helping others out!

    • @thxr9766
      @thxr9766 2 ปีที่แล้ว +12

      @@davegamedevelopment np dude! i love helping people out!

    • @МихайлоОльховий
      @МихайлоОльховий 2 ปีที่แล้ว +5

      i love you, man :D

    • @thxr9766
      @thxr9766 2 ปีที่แล้ว +2

      @cuitotech no you don't have to you can just put it in the playermovement script in the same place where he put his ground check

    • @ezzir7003
      @ezzir7003 2 ปีที่แล้ว +1

      Thanks dude , very cool.

  • @christophermohite537
    @christophermohite537 ปีที่แล้ว +67

    For anyone having trouble with the Jump function : we just have to set readyToJump to true when we begin (its not shown in the video)

    • @creativeumar10
      @creativeumar10 ปีที่แล้ว

    • @Snek5981
      @Snek5981 ปีที่แล้ว +1

      thank you I was so confused on why my jumping wasn't working!

    • @benneeds_a_name7398
      @benneeds_a_name7398 9 หลายเดือนก่อน

      Thank you!
      I wish I saw this comment before spending half an hour figuring that out!
      People really gotta like and comment on this comment so it gets higher in his comment section so others can find it faster!

    • @user-kg1ok9tw9f
      @user-kg1ok9tw9f 8 หลายเดือนก่อน

      thank you so much, this comment help me so much

    • @Fl00rless
      @Fl00rless 7 หลายเดือนก่อน

      Thanks for the help, I could not figure it out lol

  • @Amke4432
    @Amke4432 2 ปีที่แล้ว +12

    I appreciate how there’s no ads, thanks.

  • @razamondo
    @razamondo ปีที่แล้ว +43

    If you are still having trouble with "penguin sliding" after adding drag double check the position of your capsule in your player holder, if like me you moved the capsule at some point to align things it moves the starting point of the raycast with it, so make sure your capsule has 0,0,0 for position.
    For me my capsule was 0,2,0 and as such my raycast was starting lower then my player. I found this out by starting the game, then hitting esc to free my mouse then change to scene view, I then selected my player holder and unchecked "use gravity" to allow me to drag my player holder up while looking at 'Drag' in the Rigidbody and after my player was hovering ~1 unit in the air my Drag jumped from 0 to 5 which is what my GroundDrag was set to at the time

    • @StanTheMovie
      @StanTheMovie ปีที่แล้ว +3

      THANK you!

    • @lmbozz1286
      @lmbozz1286 7 หลายเดือนก่อน +1

      Thank you, this was beginning to annoy me lol

    • @alperenusta5401
      @alperenusta5401 6 หลายเดือนก่อน +1

      Thank you. That was the problem for me.

    • @Williamskau
      @Williamskau 2 หลายเดือนก่อน +1

      THANK YOU SO MUCH THAT WAS A PROBLEM FOR WAY TO LONG

    • @MrVeniVeci69
      @MrVeniVeci69 หลายเดือนก่อน

      What a nice man

  • @_ace55
    @_ace55 2 ปีที่แล้ว +245

    For anyone that has stuttering / jittering issues with their camera: There are 2 options how you can fix it
    • Remove the "* Time.deltaTime" from the PlayerCam Class where getting the input
    • Replace the "* Time.deltaTime" in the PlayerCam class with "* Time.fixedDeltaTime"

    • @consultingprestig2096
      @consultingprestig2096 2 ปีที่แล้ว +4

      I would like to know why it is not the same? The math is the same though, right?

    • @_ace55
      @_ace55 2 ปีที่แล้ว +2

      @@consultingprestig2096 I dont know the exact difference but I think the Input handler by unity already does the frame indenpendence stuff for you, so you dont need the time.deltaTime

    • @consultingprestig2096
      @consultingprestig2096 2 ปีที่แล้ว +20

      @@_ace55 Ok thank you. I also have another question; Every time I work on a project and I come back to it later there are always mistakes... I wonder if it's on their part to demotivate us from creating games... And let rockstar and all those known to keep the place of number 1? .. I say that because I don't understand how is it, with all the assets already done, that there are no games similar to GTA or Call of duty... Because these games are too loaded with server...

    • @_ace55
      @_ace55 2 ปีที่แล้ว +27

      @@consultingprestig2096 I can't tell if youre joking

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +73

      @Consulting Prestig That's the first Unity conspiracy theory I've heard so far xD

  • @cboyslim5490
    @cboyslim5490 2 ปีที่แล้ว +7

    this is the first time i've ever finished a unity tutorial lol hell yeah motivated af now

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +3

      Let's go! I also started by following youtube tutorials :D

  • @szialoo9674
    @szialoo9674 2 ปีที่แล้ว +323

    You sound alot like brackeys

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +78

      Haha I know :D

    • @Cyclonicle
      @Cyclonicle 2 ปีที่แล้ว +12

      That's what i'm sayin

    • @RoastPotatoR4L
      @RoastPotatoR4L 2 ปีที่แล้ว +28

      U know how brackets stopped yt, so maybe he made another channel so he can continue in disguise

    • @nevan2201
      @nevan2201 ปีที่แล้ว +3

      No, not really

    • @teslarichards
      @teslarichards ปีที่แล้ว +4

      He really does

  • @kenan-nynor
    @kenan-nynor ปีที่แล้ว +21

    Here is (maybe) why you cant get your jump working how you want it to be:
    Go to edit -> Project Setting -> Physics and set the Gravity Y value to -30
    I had it set to -9.81 on default but Dave is using -30 in his video (if you want to have the movement just like in the video)

    • @MILKYSPACEBRO
      @MILKYSPACEBRO 10 หลายเดือนก่อน +2

      ty

    • @Basil13ful
      @Basil13ful 4 หลายเดือนก่อน

      how did you know ? thanks

    • @kenan-nynor
      @kenan-nynor 4 หลายเดือนก่อน +3

      @@Basil13ful i downloaded the project from his discord and checked the project settings ^^
      It took me quite some time to figure it out but eventually I found it :D

  • @ExamProChannel
    @ExamProChannel ปีที่แล้ว +187

    I followed this to the letter, and I had jumping like I was on the moon. I did solve it myself by downloading the original source files and I found that the global value for the Gravity's Y value is set to -30. For a default project it set to -9, so this is an omission in the video. You can find this setting under Edit -> Project Settings and just make sure its set to -30 and you'll be back on earth lol.

    • @nemorururur
      @nemorururur ปีที่แล้ว

      i changed it to 30 and the jump height didnt change

    • @jaxisplayingtoday
      @jaxisplayingtoday ปีที่แล้ว

      @@nemorururur change it to -30

    • @olly-o3810
      @olly-o3810 ปีที่แล้ว

      I got the opposite i jump .1mm off the ground

    • @d4rkwells688
      @d4rkwells688 ปีที่แล้ว

      @@olly-o3810 I depends on the scale of ur object too. If ur player is really big you'll have to scale up ur jumpForce

    • @iDabbl
      @iDabbl ปีที่แล้ว +3

      you fucking legend. was having this same problem

  • @atomictortoise
    @atomictortoise ปีที่แล้ว +21

    for anyone struggling with the camera being outside of the player, make sure that the camera holder and the player cam objects are at the same coordinate
    anyone struggling with the player not jumping, add readyToJump = true; to Start() and make sure the player starts while touching the ground

    • @MichaelDub
      @MichaelDub ปีที่แล้ว

      thx

    • @Pablo500904
      @Pablo500904 ปีที่แล้ว

      thank you

    • @jordanlewis5129
      @jordanlewis5129 6 หลายเดือนก่อน +1

      I tried that and the camera is still outside of the player

    • @TVmations
      @TVmations 3 หลายเดือนก่อน

      @@jordanlewis5129 try putting the position to 0 in PlayerCam

    • @greeber99
      @greeber99 หลายเดือนก่อน

      when i try to change that it just disappears out of the player like they don't want to have the same cords

  • @abu0082
    @abu0082 ปีที่แล้ว +3

    This guy is on another league, HE UNDERSTANDS QUATERNIONS!!

  • @JATEK0S
    @JATEK0S 2 ปีที่แล้ว +268

    intro 0:00
    camera 0:27
    movement 3:22
    drag & speed control 5:16
    jumping & air control 7:27

  • @danielmckellar3861
    @danielmckellar3861 7 หลายเดือนก่อน

    man you probably wont see this but you have no idea how helpful these videos are. thank you so much!

    • @DaveSucker
      @DaveSucker 7 หลายเดือนก่อน

      are you a developer if you are i can give you any unity project or asset that is on my chanel for a very cheap price that we end up with after bargaining there is no one on youtube doing this and it would be with proofs and have a refund policy to if you have a better excuse

  • @CrashStar456
    @CrashStar456 หลายเดือนก่อน

    best first-person movement tutorial ive ever seen. but one thing- you need to add the line "readyToJump = true;" in void start() or else you cant jump

  • @byte-sized-tech
    @byte-sized-tech 2 ปีที่แล้ว +28

    This man is the new brackeys no cap. Seriously though, amazing tutorials.

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +4

      Thanks a lot, that's about the highest compliment you could give me :D

    • @Mr_BlueBanana
      @Mr_BlueBanana 2 ปีที่แล้ว +2

      @@davegamedevelopment you even sound like brackeys. I sense potential

    • @Inferim
      @Inferim 9 หลายเดือนก่อน

      That said, I can imagine a DGD branding for merch!

  • @willb7484
    @willb7484 2 ปีที่แล้ว +25

    Tip: If you player is sticking to walls, create a Physics Material and set all friction to 0 and then apply that to your walls

    • @skrol76
      @skrol76 2 ปีที่แล้ว

      Where is Physics Material? I can't find it :( I found only Physics Material 2D

    • @willb7484
      @willb7484 2 ปีที่แล้ว

      @Juka not sure why this didn't cross my mind too. Good suggestion

    • @Diamond-yn4nu
      @Diamond-yn4nu 2 ปีที่แล้ว

      I will try it thanks

    • @Diamond-yn4nu
      @Diamond-yn4nu 2 ปีที่แล้ว

      I added it to the blayer capsule colider

  • @mayankkoli2300
    @mayankkoli2300 2 ปีที่แล้ว +9

    if anyone is having a problem that their player jumps too high and falls too slowly go to Project Settings -> Physics and sety the y value to something even lower i found -30 worked darn good for me

    • @scrooloose4473
      @scrooloose4473 2 ปีที่แล้ว +3

      Thanks! I had fun flying all over the place tho :)

    • @croeusjawad9744
      @croeusjawad9744 2 ปีที่แล้ว

      For me, -20 worked much better

    • @firefoxcyan7564
      @firefoxcyan7564 2 ปีที่แล้ว

      Instead of changing the gravity of the entire game just add the fall multiplier to the specific rigidbody you want to change

  • @martinjensen4563
    @martinjensen4563 ปีที่แล้ว +1

    Just wanna thank you i am in a group projekt and the guy that was supposed to make the code didn't do any work so I had to do it in two days with no codig experience so just wanna thank you for saving my projekt

  • @Tye_gameDev
    @Tye_gameDev 7 หลายเดือนก่อน +2

    I looked at over 10 videos, but this... this is just the best. Keep up the great work!

  • @Jezy258
    @Jezy258 2 ปีที่แล้ว +96

    Couple of things, first off. thank you for making this video, it helped a lot!
    Second, I couldnt jump.
    Tried to check if i was grounded and played with the variables for awhile, but I had some issues finding out if i was grounded and the consol log was really confusing so i used this code in the Update() section :
    Debug.Log(grounded);
    if (Input.GetKey(jumpKey))
    Debug.Log(jumpKey);
    it helped me confirm real time if i was grounded or not so i could alter the varibles until i was actually grounded, and if the game was registering me pressing space bar.
    However i was unable to jump because I initially did not have "readyToJump" set to true.
    I fixed this adding this code to Start() section
    ResetJump();

    • @Sultan-Ahmet-Al-Maturidi
      @Sultan-Ahmet-Al-Maturidi 2 ปีที่แล้ว +8

      tysm u rly helped me out!

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +10

      Appreciate the help for others!

    • @whitefox9077
      @whitefox9077 2 ปีที่แล้ว +4

      I followed what you said, and I'm still having trouble jumping, idk else to do, also first time coding

    • @guilherme3537
      @guilherme3537 2 ปีที่แล้ว +1

      You can also just set the variable to true when declaring it.

    • @biscuitsandgravy1608
      @biscuitsandgravy1608 2 ปีที่แล้ว +2

      Just helped me out, thank you!

  • @unleasheddevil1698
    @unleasheddevil1698 2 ปีที่แล้ว +5

    oh your finally back after 1 year
    pls continue making content your doing good
    Thanks.

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +4

      Yes I'm finally back :D Glad you enjoy my content!

  • @jacksmith7139
    @jacksmith7139 2 ปีที่แล้ว +18

    Thanks a lot Dave, appreciate the fact you're providing this content, and consolidating it to only 10 minutes so we can crunch through it. Its a good way to work.
    All the best!

  • @Sputterbug
    @Sputterbug ปีที่แล้ว +2

    this is the best movement tutorial ive been able to find since Brackeys, thank you :)

  • @Aragos207
    @Aragos207 ปีที่แล้ว +8

    If your player is sticking to walls add a physics material to the player mesh collider and set the physics materials settings to 0,0,0 minimum, and minimum. Hope this helps!

  • @liamwhillier3334
    @liamwhillier3334 2 ปีที่แล้ว +31

    This was an Amazing guide, and it helped a lot with my first game!

  • @Toon444
    @Toon444 6 หลายเดือนก่อน +3

    If anyone is having trouble with having really floaty jumps where you fall really slowly, here's how to fix it:
    Go to Edit -> Project settings -> Physics -> Gravity Y and change this Y value to something even smaller (for me -29.43 works pretty well, which is 3*(-9.81) so three times the normal gravity)
    You're welcome!

    • @mr.m7724
      @mr.m7724 3 หลายเดือนก่อน

      didn't quite work, it still has the feel just faster now, especially when jumping off something

  • @donajello
    @donajello 2 ปีที่แล้ว +100

    Anyone having trouble with the "penguin sliding" even after adding the drag and all, try moving your environment/whatever has whatIsGround layer down on the Y by -0.7. If your Player empty starts are 0,0,0 the Groundcheck does something weird and doesn't recognize that you're on the ground (at least on my end)

    • @arcadetitan
      @arcadetitan 2 ปีที่แล้ว +5

      This did not work for me, what can I do?

    • @adriandeveraaa
      @adriandeveraaa 2 ปีที่แล้ว +3

      you need to extend your raycast length check. if your ground is -0.7 below your character then it wont pass. playerHeight * 0.5f means it is checking a ray length of 0.7 which may not include the -0.7 you are at. Try increasing it by changin it playerHeight * 0.5f + 0.3f for a total of 0.8f length to intersect the floor

    • @donajello
      @donajello 2 ปีที่แล้ว +1

      @HyDay it wasn’t an issue with the script, it was an issue with the objects in the scene? downloading the script from the description did not and would not have solved this problem.

    • @donajello
      @donajello 2 ปีที่แล้ว +2

      @HyDay no worries pal- yes you’re correct in saying that downloading the project straight from the creator WOULD solve this problem, but i personally wouldn’t find it all too gratifying. i’m still really early in learning Unity but i find trial and error is a better learning method than copy and paste haha

    • @supersentaimexicano1967
      @supersentaimexicano1967 2 ปีที่แล้ว

      @@damurlive Thanks D'mur. I just have now a new problem since I can double Jump, and even jump just before I touch the ground

  • @GaryParkin
    @GaryParkin ปีที่แล้ว +2

    Thank you so much for the tutorial. Even after a year it's helping folks like me. And what's best is you already made the next video and I can go watch it.

    • @xuanki1
      @xuanki1 ปีที่แล้ว

      Did you make it so the camera works? I swear I did everything in this video, and everything works but the camera doesn't.

    • @GaryParkin
      @GaryParkin ปีที่แล้ว

      @@xuanki1Yes, the thing to remember is the mouse movement is connected to the camera, not the body. I've watched one where the guy had the camera stationary and the player needed to bend down to see. that's bogus and can't work in a real game.

  • @roninxronin_
    @roninxronin_ 3 หลายเดือนก่อน

    Saved from failing an assignment. Thank you so much

  • @thefunnybuddy4138
    @thefunnybuddy4138 2 ปีที่แล้ว +16

    I played dying Light 2. I don't like how the controller feels. So now I'm trying to understand how movement, vaulting, etc. works. Then make an obstacle course, code in the movement and tune it until it feels fun.

  • @jcd9456
    @jcd9456 2 ปีที่แล้ว +11

    Thank you very much for the code! I got to test each part on my own after watching your full vid. When following other youtubers as they code (Cuz code not provided) I always ended up messing the copy so I can't test it properly. Thank you once again!

  • @Seestral
    @Seestral 2 ปีที่แล้ว +22

    Just found your channel. Thanks for all the tutorials you're doing and keep it up!

  • @EzeBryan
    @EzeBryan หลายเดือนก่อน +1

    Love your tutorial. Did i forget to mention your voice so resembles brackeys😊😊😊

  • @rumitmaharjan4699
    @rumitmaharjan4699 21 วันที่ผ่านมา

    THIS GUY IS THE REAL ONE, said 10 minutes but the video isnt even 10 minutes

  • @ThePianoPlayerOfficial
    @ThePianoPlayerOfficial 2 ปีที่แล้ว +4

    After some time, i finally found a useful tutorial on detailed fps controller, thank you so much for this tutorial

  • @pridful6103
    @pridful6103 2 ปีที่แล้ว +11

    Thank you so much the movement is very smooth.
    For the jump i had an issue where it didnt work although the script had no error
    I fixed that with putting resetJump() in Start()
    After that i realised i could keep jumping higher and higher if i held Space
    It has to do with this code : grounded = Physics.Raycast(transform.position, Vector3.down, playerHeight * 0.5f + 0.2f, whatIsGround);
    Change the "playerHeight * xf" depending on your playerHeight both the variable and the playerObject
    Hope this helps :)

    • @imrealgigachad
      @imrealgigachad 2 ปีที่แล้ว

      Thank you so much for saving my time :D

    • @SpiritualSteve
      @SpiritualSteve 2 ปีที่แล้ว

      i dont understand. What do i change?

    • @imrealgigachad
      @imrealgigachad 2 ปีที่แล้ว

      @@SpiritualSteve you should make the changes in the player movement script

    • @ache7795
      @ache7795 2 ปีที่แล้ว

      @pridful it says that "xf" does not exist in current context how do i fix it?

    • @imrealgigachad
      @imrealgigachad 2 ปีที่แล้ว

      @@ache7795 copy your original code andmake this, if code get error, paste it old code

  • @thunderx3005
    @thunderx3005 2 ปีที่แล้ว +6

    Thank You bro I needed this 💪🏾

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +2

      Glad I could help!

    • @thunderx3005
      @thunderx3005 2 ปีที่แล้ว +2

      @@davegamedevelopment exited for next weeks video 🤩

  • @FergiesHuman
    @FergiesHuman 5 หลายเดือนก่อน

    I don't often thumbs-up videos but this one deserved a big one

  • @HiddenAway-j6s
    @HiddenAway-j6s 22 วันที่ผ่านมา

    great my first time working with 3d and this tutorial is easy to understand

  • @GroupNebula563
    @GroupNebula563 ปีที่แล้ว +3

    I love that this comes up when you search “unity bean”

  • @stef9019
    @stef9019 2 ปีที่แล้ว +8

    It's probably something I did wrong, but I had issues with the groundcheck. Saw some fixes in the comments but didn't want to implement those. For other people having the same issue; make sure the raycast is being casted from roughly the middle of the character.
    For me, for some reason it was being casted form the bottom, which created some issues apparently. Probably something wrong with the playerheight * 0.5f + 0.2f. Still figuring out what though.
    I realized this by using the Debug.DrawRay method which is a really useful tool for debugging. I ended up adding 1.0f to the y coordinate of the origin variable from the Raycast method.
    I also had to set readytojump to true in Start() method.
    Thanks so much for this video!

    • @ljunderground
      @ljunderground 2 ปีที่แล้ว +2

      Thanks this was really helpful and a cool debug tool I will use in the future. I didn't add the 1.0f. Instead by seeing where the Raycast was being drawn from I could tell that both my PlayerObject and Orientation child Player objects had the wrong Y value. This was because I had a cube floor that set the Y value higher. So I reset the Y values to 0 and lowered the floor and boom working. Basically, the raycast was being drawn from the location of my Orientation object inside the Player.

    • @trefl4_797
      @trefl4_797 2 ปีที่แล้ว

      Thank you very much for your help ! I had the problem for the Y coordinate thanks to you it works! Thanks a lot !

    • @bloudy.x
      @bloudy.x 2 ปีที่แล้ว

      Thanks!!!

  • @TeaCupToast
    @TeaCupToast หลายเดือนก่อน +2

    I have 2 months to make a game better than anyone in my whole city, if I win I can genuinely make a lot of money out of it and get future job offers, thanks for the tutorial :D (I don't know any C# so I literally learn while making said game, it'll be kind of bad though)

    • @sonoakneely9574
      @sonoakneely9574 หลายเดือนก่อน

      its C#💀💀💀

    • @TeaCupToast
      @TeaCupToast หลายเดือนก่อน

      @@sonoakneely9574 yeah, I had 2 hours of sleep, I always mess them up, I am learning from scratch rn😭🙏

    • @Mttlvsapps
      @Mttlvsapps หลายเดือนก่อน

      GL

  • @spritz4385
    @spritz4385 หลายเดือนก่อน +1

    thanx for video and spend your energy for people

  • @theMinecraftman87
    @theMinecraftman87 ปีที่แล้ว +3

    Good enough guide. Got me 90% of the way there. Nice product. smooth realistic movement.

  • @Yukiikakkoi
    @Yukiikakkoi ปีที่แล้ว +4

    This is very good I just started coding in unity and I understand the code very well with this!

  • @rpc6882
    @rpc6882 2 ปีที่แล้ว +10

    Thank you so much for breaking all this down. Please keep up the good work.

  • @airficetimehunter1317
    @airficetimehunter1317 7 หลายเดือนก่อน +1

    If you have problems with the velocity after a jump (while returning to the ground) just try lowering the player's height because the problem is most likely related to the ground check parameters.

  • @brayangames5062
    @brayangames5062 2 ปีที่แล้ว +1

    Thank you, I watched many videos and none worked because it bugs, but your script worked
    +1 sub

  • @Draggie306
    @Draggie306 ปีที่แล้ว +3

    Great video, thank you so much!
    In the Update function, if you are ever stuck between two things and NOT grounded, you can insert this code to become unstuck and jump.
    // if movement hasn't changed since last frame, set grounded to False
    if (rb.velocity.x == 0 && rb.velocity.y == 0 && rb.velocity.z == 0)
    {
    grounded = true;
    // this is to prevent the player from becoming stuck
    }

  • @gabxvyan
    @gabxvyan 2 ปีที่แล้ว +4

    "A transform for the player's orientation"
    I died at that moment

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +1

      Haha I guess you need to watch some basic tutorials on Unity Variables First :D

  • @FhPe
    @FhPe ปีที่แล้ว +5

    i added a second ground checking method for this script, so it was able to detect terrain and you can too:
    first go to the start of the PlayerMovement Script
    locate the header "Ground Check" and add this below the line where it says "bool grounded;"
    bool groundtouch;
    then go to where it says "private void Update()" and below where it says "// ground check" add this
    grounded = groundtouch == true;
    then go to the end of the script and add this
    private void OnCollisionStay (Collision collision)
    {
    if (whatIsGround == (whatIsGround | (1

    • @alexdavies9250
      @alexdavies9250 ปีที่แล้ว

      Thank you sooooo much as none other fixed it, but yours did!

    • @FhPe
      @FhPe ปีที่แล้ว

      @@alexdavies9250 always happy to help!

  • @TakaShitake-rt8bz
    @TakaShitake-rt8bz ปีที่แล้ว

    A Unity Player Character Controller tutorial - that DOES NOT USE THE UNITY CHARACTER CONTROLLER COMPONENT - you just blew my mind!

  • @leiahoo-hing8282
    @leiahoo-hing8282 2 หลายเดือนก่อน +1

    For anyone still having an issue with jumping after doing all the fixes listed here, I realised on the inspector for the player, you need to go to the ground check where it says "What Is Ground?" and set the drop down to whatIsGround.

    • @BulkwarkEnzo
      @BulkwarkEnzo หลายเดือนก่อน

      many blessings to you and thank you for help!!!

  • @asstra_s
    @asstra_s 2 ปีที่แล้ว +6

    This is perfect. I hope you upload everything you showed at the beginning.

  • @polix9999.2
    @polix9999.2 2 ปีที่แล้ว +4

    i Cant wait for the next tutorial broo !!❤️

  • @karakazma
    @karakazma 2 ปีที่แล้ว +6

    It's the fifth time i watch this to help me start my projects, so a big thanks to share your knowlage with us. I just have allways a small issue : Does thats normal that my player (capsule) dosen't follow / rotate himself with the camera and the movement ? (he move and jump perfectly, its just on the visual the capsule dosen't rotate).

  • @yasser_gg2276
    @yasser_gg2276 11 หลายเดือนก่อน +1

    its amaaazing bro its just a very clear and easy tutorial THANKS KEEP GOING 😄💖

  • @TimeWisely
    @TimeWisely 10 หลายเดือนก่อน

    For anyone confused on why you can't jump: It appears (Unless I missed it) that dave put the line of code into the start function that reads "readyToJump = true;" so add that to your script and it should work fine. :)

  • @elepot5168
    @elepot5168 ปีที่แล้ว +3

    You shouldn't multiply Time.deltaTime in this case. It makes the sensitvity higher when the frame rate is low
    You can test extreme framerate cases for debugging using Application.targetFrameRate = something low like 16

    • @Alander787
      @Alander787 8 หลายเดือนก่อน

      yup, works a lot better for me. Had my camera pointing a bit up every few turns, it was annoying. getting rid of this multply helped. thanks :)

  • @sillyninja65
    @sillyninja65 2 ปีที่แล้ว +9

    to invert controls add a - in your sensY (up) before your integer.
    i.e:
    SensX : 200
    SensY: -200

    • @xwalfie
      @xwalfie 2 ปีที่แล้ว

      this is helpful but useless so without offense im going to spell out some facts: i dont get why developers like to add inverted controls like BRO WHO TF USES IT

    • @yes-420
      @yes-420 2 ปีที่แล้ว +2

      @@xwalfie People that like inverted controls

    • @xwalfie
      @xwalfie 2 ปีที่แล้ว

      @@yes-420 shut your house door down up left right

  • @sp4ky91
    @sp4ky91 2 ปีที่แล้ว +7

    I've found that using a check capsule is much better for a ground check because it checks an area under your character instead of a line
    grounded = Physics.CheckCapsule( transform.position , transform position - new Vector3(0,(playerheight * 0.25f + 0.2f), 0), radius, whatisground;

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +2

      Yeah that's probably a bit better. You could also use a SphereCast or Physics.CheckSphere :D

    • @chouliar
      @chouliar ปีที่แล้ว

      you just save me with this, thank you so much.

    • @cukr7089
      @cukr7089 หลายเดือนก่อน

      You saved me bro my grounded from the tutorial just did not want to work and i had no idea why XD.

  • @ewthat
    @ewthat ปีที่แล้ว

    I needed this I switched from ue5 to unity cuz it seems more practical in some ways but I still didn't master the coding still learning so yeah thanks man

  • @yes3714
    @yes3714 9 หลายเดือนก่อน

    In the current version of unity for 2022, i would recommend setting Collision detection to continuous dynamic rather than just continuous. This may reduce bumpiness when walking.

  • @kimathi6661
    @kimathi6661 2 ปีที่แล้ว +13

    I know I'm late to comment, but instead of doing what Dave did to fix the camera jittering, you can also multiply mouseX and mouseY by Time.smoothDeltaTime instead of the standard Time.deltaTime.

    • @sclexz
      @sclexz ปีที่แล้ว +1

      do u have any idea why my camera is jittery when moving?

  • @bradleygallavin7378
    @bradleygallavin7378 2 ปีที่แล้ว +4

    Thanks for this, just what I was looking for!

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +2

      Glad I could help!

    • @bradleygallavin7378
      @bradleygallavin7378 2 ปีที่แล้ว +1

      @@davegamedevelopment very much so! Finished implementing the jumping today, very chuffed! 😊

  • @w0rkhop555
    @w0rkhop555 2 ปีที่แล้ว +15

    Ik this vid is older but following this tutorial i found 1 major flaw and was wondering if anyone had a fix for it, when you hold jump, the raycast at your feet extends slightly below the collider, so you jump before you even touch the ground, this also affects crouching on slopes if you jump while crouched on a slope you will float in the air, i tried reducing the raycast distance for ground detection but that made it impossible to use slopes cause they were too far away, considering best solution is to have a sphere below player that is not only slightly lower to the ground but also slightly larger than the width of the player collider so it could work on slopes

    • @ManjCactus
      @ManjCactus ปีที่แล้ว +2

      I dont know if i m too late but here is a video that explain is grounded in details, and talk about slops at the end and how to fix it
      th-cam.com/video/j41UHuA1bLM/w-d-xo.html
      if i understood correctly you detect the vector of what your walking on and know if its a slop
      gl man

    • @SuperGamePlayOfficial
      @SuperGamePlayOfficial ปีที่แล้ว

      might be a bit,late but in the method Update we check if whe are grounded just decreas 0.3f to like 0.1f this wil remove your problem
      you could also make a new float for example float groundDistance give it a value of 0.1f like this
      float groundDistance = 0.1f;
      in Update instead of doing 0.5f + 0.3f we are gonna do 0.5f + groundDistance
      this way you could easily assign a value in the unity inspector. i hope this helped

    • @w0rkhop555
      @w0rkhop555 ปีที่แล้ว

      @@SuperGamePlayOfficial shortnening the height of the cast doesnt fix the issue only makes it harder to see but i ended up finding a solution and i redid my ground detect entirely

    • @SuperGamePlayOfficial
      @SuperGamePlayOfficial ปีที่แล้ว

      @@w0rkhop555 thats great to hear, let me guese are you using a physics.checksphere?

    • @w0rkhop555
      @w0rkhop555 ปีที่แล้ว

      @@SuperGamePlayOfficial that and a combination of other raycasts for stuff like slopes and such, i have something to align the player to the ground for a few frames which is unoticable so when they hold jump they jump the same height every time

  • @BILGI_PASA
    @BILGI_PASA 2 ปีที่แล้ว +1

    Thank you DAVE, this video helped me really much.

  • @dankojanco2301
    @dankojanco2301 4 หลายเดือนก่อน +1

    Hi, first of all I want to thank you. I was trying to find atleast one good tutorial that actually explained why it need to be like that or why you must write this line of code and I found you. Well and briefly explained.
    Why I am writing this? I encountered some problems that I would be glad you would help to resolve.
    1. Problem is, whenever I jump I fall very slowly. I tried everything, from writing some myself made code to searching internet.
    2. Problem is, when I fall down and hit the ground, the player (don’t know how to explain this but) bugs in for microsecond and then it goes on the ground as it should. It doesn’t bug all the way in, just to y = 0.5 (transform of my player is y = 1) and as the camera is following the position of player then it makes like a weird screen tear when where you hit the ground the view goes down for a sec and then normal.
    I would be very happy if someone who has enough knowledge and is willing to help me will actually help me.
    Thanks for any response.

  • @imfaded3105
    @imfaded3105 2 ปีที่แล้ว +5

    Great tutorial 🙌🏻🔥

  • @TheRickoast
    @TheRickoast ปีที่แล้ว +3

    HElLo Davers, If you want to make the jump a bit snappy like many oher games where it takes less time to land than to reach max height you can Add this line of code in the else if part of your MovePlayer function davers.
    The line of code is:-
    rb.AddForce(Vector3.down * landingGravityMultiplier);
    just add a public variable landing Gravity multiplier and play with it I like keeping it at 5.
    The code should now look like:-
    private void MovePlayer()
    {
    moveDirection = orientation.forward * verticalInput + orientation.right * horizontalInput;
    if (grounded)
    {
    rb.AddForce(moveDirection.normalized * moveSpeed * 10f, ForceMode.Force);
    }
    else if(!grounded)
    {
    rb.AddForce(moveDirection.normalized * moveSpeed * 10f * airMultiplier, ForceMode.Force);
    rb.AddForce(Vector3.down * landingGravityMultiplier);
    }
    }
    Good luck!

    • @NytroKing
      @NytroKing ปีที่แล้ว +1

      Amazing, thank you !

    • @Retago2002
      @Retago2002 10 หลายเดือนก่อน +1

      You're a real lifesaver. Thanks!

  • @Ally-ve3wt
    @Ally-ve3wt 2 ปีที่แล้ว +8

    I had an issue where I just couldn't jump. Figured out after a while that the bool for ready to jump wasn't on by default. I still haven't figured out what I did wrong to cause that, but the fix is just to make Ready To Jump public and tick it off or add a line of code to set it to true as the script loads.
    edit: yeah that was me lol

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +2

      Yes, I set it to true in void Start(), but I think I showed that in the video? :D

    • @namaloneditz9416
      @namaloneditz9416 2 ปีที่แล้ว +2

      I had a similar problem and this comment helped so much thank you! :D

    • @Daminoa
      @Daminoa 2 ปีที่แล้ว

      hey, how would i set it to true as the script loads?

    • @NA-jy4zd
      @NA-jy4zd 2 ปีที่แล้ว

      @@Daminoa where it says "bool readyToJump;", change it to "bool readyToJump = true;"

    • @consultingprestig2096
      @consultingprestig2096 2 ปีที่แล้ว

      @@davegamedevelopment you don't said this :'D its a joke

  • @humanharddrive1
    @humanharddrive1 หลายเดือนก่อน

    he really knows how to get me. I clicked the "DONT CLICK" button

  • @veritablehordes2525
    @veritablehordes2525 23 วันที่ผ่านมา

    This was good. Thanks!

  • @wolfsmith9342
    @wolfsmith9342 2 ปีที่แล้ว +6

    Thank you very much . This is a REALLY smooth controller I really hope ep2 will come soon . bty do you know how to make air strafing and ramp slid like Demoknight Trimping in TF2 and CSGO.

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +4

      Thanks, glad you like it!
      I know the mechanics you're talking about but never really tried coding them. Try googling for "Csgo Air straving Code", but you need to be quite good at vector maths for this :D

  • @Intention212
    @Intention212 2 ปีที่แล้ว +6

    This tutorial is amazing! it works really well except for one thing for me at least I keep on getting thrown into the air when I Jump. At first I used mostly my script in my game and still had the same problem so I just copied over yours to see if it had anything to do with the code and the same thing happens. gravity is set to -30. One more thing my character whenever I jump and move slightly it will keep on jumping to the direction I went in. Also the jumping seems to be randomized for some reason. Sorry for the long comment just really confused on why this is happening.

    • @Bob-tw9fx
      @Bob-tw9fx 2 ปีที่แล้ว +1

      I have the same problem so far i am trying different things too, if you figure it out pls let me know so i can understand what is wrong with what i have done. Thank you very much.

    • @dev-menon
      @dev-menon 2 ปีที่แล้ว +1

      I have this same problem. Please inform me if you find a solution.

    • @gilstruyf8400
      @gilstruyf8400 2 ปีที่แล้ว

      Also have the same problems... Its verry weird.

    • @logan_oberly6968
      @logan_oberly6968 2 ปีที่แล้ว

      Please tell me someone has found a solution I also have that bug

    • @gilstruyf8400
      @gilstruyf8400 2 ปีที่แล้ว

      @@logan_oberly6968 Change grafity to 30

  • @Little_chuff
    @Little_chuff ปีที่แล้ว +10

    I swear this is Brackeys, Also thanks so much! I'm doing a game jam and this series will help me so much! Thanks! (I subbed btw) I alos have a problem where my physics is on 0, -30, 0 but im still falling slow and when I hold space I jump in mid air. What do I do???

    • @holloe0
      @holloe0 5 หลายเดือนก่อน

      try looking to grounded code because in my case grounded wasnt working and i did it my own way

  • @chouliar
    @chouliar ปีที่แล้ว

    thanks for the tutorial, if your camera is outside the player, change the y of position of cameraPos (in cameraPos -> inspector -> transform) and set it to 0, it might work after.

  • @juanluisg6980
    @juanluisg6980 7 หลายเดือนก่อน

    [8:43] _Ground Check_
    In this way, it is possible to detect the ground even when it is on the edge of the platform.
    In addition to using a list if there are multiple "terrains" within the collider.
    If you use this method, I also advise customizing the collider detector using a custom tag. Using the "Layer Collision Matrix" settings

  • @zedude21
    @zedude21 ปีที่แล้ว +4

    It's always fun to see different solutions to the same problems. Well done!
    I wouldn't say auto jump while holding the jumpkey was a missing feature in a player controller, but it's nice that you covered the concept.

  • @bizi-e3v
    @bizi-e3v 2 ปีที่แล้ว +6

    I followed the steps up until air control and jumping and when i press play i cannot move my character. I downloaded the movement script from the Desc. and i have applied and completed the player camera and camera movement scripts.

  • @M_arco
    @M_arco 2 ปีที่แล้ว +4

    I suddenly have a problem that I'm unable to move. This happened after I dragged my player to a new spawn position, any idea how to fix this? :(
    Edit : i fixed it you just download the code in the desc and it will work

  • @skave7228
    @skave7228 ปีที่แล้ว +1

    9:17 I was not expecting ASMR out of nowhere x)

  • @TakaShitake-rt8bz
    @TakaShitake-rt8bz ปีที่แล้ว

    but honestly I do want to eventually make a hockey/ice-skating game so the part up to 4:54 is pure gold. Now at least I got a nice head-start on that. Amazing tutorials. Subscribed. Can't wait for more

  • @MagustenTV
    @MagustenTV 2 ปีที่แล้ว +12

    Thank you for the very amazing guide!
    I'm trying to make my first game, so this really helped!
    I've heard a lot of nice things about the new input system, and can see that it has some clear strengths. I am however not at a level, where I know how to create what I see in this video, in the new input.
    Is there a chance you could give us a walkthrough on how to do that:)?

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +5

      Glad I could help you! And I'll think about covering the new input system :D

    • @noirlavender6409
      @noirlavender6409 2 ปีที่แล้ว

      @@davegamedevelopment Please do!

  • @666-d5y
    @666-d5y 2 ปีที่แล้ว +7

    why does his jumping feel so natural but mine feels like im floating around in the air for a bit, is there a way to fix this?

    • @geekycrafter3709
      @geekycrafter3709 9 หลายเดือนก่อน +2

      i know its 1 year late, but i found its because the project files he's using has gravity set to -30. When i downloaded the project files and opened stuff to find out my errors, that's what i found. Edit ----> Project Settings ----> Physics ----> Top row, Gravity, set Y value from -9.81 to -30.

    • @666-d5y
      @666-d5y 9 หลายเดือนก่อน

      @@geekycrafter3709 thanks for that lol, ive stopped doing unity, doing ai stuff now. ngl wouldnt that mess up the behavior of rigidbodies, anyways

  • @danielreipt
    @danielreipt 2 ปีที่แล้ว +7

    I've seen all the comments and there are code or game errors! So I decide to help you maybe!
    1st Camera Problem: I tried to solve the camera problem and I got it but I don't know if it's good or not because of other things who knows!
    -Fixed:The object of "CameraHold" to the object of "Player"(Type of root family).
    |- - - - - - - - - - - - - - - - - - - - - - - - - |
    2nd Floor Problem: I didn't have any problems with the floor or gravity but if you guys had it here:
    -1st Fixed:Lazer is missing (Click on the object floor and you have the right information on that layer! If you can't find the video here, time: 6:07.
    If not then another problem is Unity gravity:
    -2nd Fixed:You own youtube said:
    ave / GameDevelopment
    Edit -> project settings -> physics
    I normally Change it to 0, -30, 0 :D.
    And there are more things but I don't put because I'm not programming or things but if you guys want more so I could chat here but it took a while O.o!
    If you can't find the time video here:

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +1

      Appreciate that you're trying to help!

    • @OB1cobi
      @OB1cobi 2 ปีที่แล้ว +1

      I cannot begin to explain how much this helped me on the camera, legit got stuck for almost an hour and coudn't make sense of what was wrong. Thanks so much

    • @danielreipt
      @danielreipt 2 ปีที่แล้ว +1

      @@davegamedevelopment Thx.

    • @danielreipt
      @danielreipt 2 ปีที่แล้ว +1

      @@OB1cobi Thx :P

    • @Ultixa
      @Ultixa ปีที่แล้ว

      when I click play to see If my camera works, I don't see from players perspective ( original camera ), I see my player ( 3rd person view ) from a camera that I have no Idea where is it

  • @Chocochoco22
    @Chocochoco22 11 หลายเดือนก่อน

    Everytime I go back here I learn new things, mostly because Im now learning how things work, this really helps alot.

  • @landisnuts8884
    @landisnuts8884 9 หลายเดือนก่อน

    If anyone is having issues with still being slippery and not able to jump, add "orientation" to the Physics.Raycast(orientation.transform.position line

  • @iceb5743
    @iceb5743 2 ปีที่แล้ว +5

    Great Tutorial your videos always help me! It worked on looking around, but I’ve done everything you did for the x and y movement and I still can’t seem to move? Any idea why?

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +3

      Did you create the whatIsGround layermask? :D

    • @iceb5743
      @iceb5743 2 ปีที่แล้ว

      No, I didn’t realize that was needed. Thanks!

    • @iceb5743
      @iceb5743 2 ปีที่แล้ว +2

      I got the movement to work, but I don’t move in the direction I’m facing, I move where the camera is pointing in scene (even if I’m facing backwards and I hit w I’ll go backwards)?

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +4

      @@iceb5743 That's how this controller works, but it's easy to change, just put your player graphic into the orientation Objekt (everything in there will rotate with the camera)

    • @iceb5743
      @iceb5743 2 ปีที่แล้ว +1

      Thanks a lot!

  • @Zman2589
    @Zman2589 2 ปีที่แล้ว +6

    really strange issue, so when i move and jump everything is fine if i jump repeatedly, but if i move and jump once its like the player stops for a split second and then continues moving smoothly

    • @Scrumpy_Bear
      @Scrumpy_Bear 5 หลายเดือนก่อน +1

      Maybe a bit late - but for anyone else having this problem: create a physics material and reduce it's friction to zero. Then, apply that material to your player (The capsule. You need to drag it into the "Material" slot in the capsule collider). You can add that mateiral to the ground and any other objects in your scene too. This has the added benefit of having your character no longer getting stuck to walls, and it will stop your player from losing momentum after a jump.

    • @alphaton_
      @alphaton_ 5 หลายเดือนก่อน +1

      @@Scrumpy_Bear tysm

    • @Scrumpy_Bear
      @Scrumpy_Bear 5 หลายเดือนก่อน

      @@alphaton_ My pleasure my treasure

  • @JSO18
    @JSO18 2 ปีที่แล้ว +5

    why is your jump so much more snappy/quick than mine is? Did you alter some gravity value? If so, how? Does it have to be done through a script or is there an option in the editor to change it?

    • @JSO18
      @JSO18 2 ปีที่แล้ว

      I ended up turning off rigidbody gravity and using a script to add a custom gravity force, but I would still like to know if there is a better way to do this.

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +5

      Go to Project Settings -> Physics -> Gravity and set it to something like 0, -30, 0 :D

    • @JSO18
      @JSO18 2 ปีที่แล้ว

      @@davegamedevelopment thank you so much, my artificial gravity force was working but was a little more annoying to work with, this is exactly what I was looking for.

    • @Little_chuff
      @Little_chuff ปีที่แล้ว

      @@davegamedevelopment That doesn't work for me.

  • @luccabobucca
    @luccabobucca 11 หลายเดือนก่อน

    For those having trouble with jumping despite all other fixes... check that the player height is the same height as the capsule collider gameobject (i.e, check the player object's capsule collider, mine was a height of 2, and I kept using the scale instead of the true height.)

    • @GermanDev_blend
      @GermanDev_blend 11 หลายเดือนก่อน

      Hi could you help me with the camera im having problems with rotating it horizontally in the new unity version(2022.3.15f1)

    • @Faiz2979.
      @Faiz2979. 10 หลายเดือนก่อน +1

      why i still cant jump, my player height are the same as the capsule height.

  • @siddharthshah2274
    @siddharthshah2274 11 หลายเดือนก่อน +1

    Good video, amazing help. Thank you.

  • @Rokyloreq
    @Rokyloreq 2 ปีที่แล้ว +9

    If you want to make the mouse look smoother, then just do this.
    ----------------------------------------------------------------------------------------------------
    // get desired rotation
    Quaternion desiredOrientationRot = Quaternion.Euler(0, yRotation, 0);
    Quaternion desiredTransRot = Quaternion.Euler(xRotation, yRotation, 0);
    // rotate cam and orientation
    transform.rotation = Quaternion.Slerp(transform.rotation, desiredTransRot, smooth * Time.deltaTime);
    orientation.rotation = Quaternion.Slerp(orientation.rotation, desiredOrientationRot, smooth * Time.deltaTime);
    ----------------------------------------------------------------------------------------------------
    set smooth to a value you like.

    • @davegamedevelopment
      @davegamedevelopment  2 ปีที่แล้ว +2

      Appreciate the help!

    • @10Exia25
      @10Exia25 2 ปีที่แล้ว +1

      where do i put this code ?

    • @Rokyloreq
      @Rokyloreq 2 ปีที่แล้ว +2

      @@10Exia25 In update under the " Xrotation = mathf.clamp " stuff.

    • @frescade7578
      @frescade7578 ปีที่แล้ว

      thanks, took me awhile to figure anything out then just found this simple comment 😂