3D TUTORIAL: Make Smooth 3D Movement in Godot 4

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ม.ค. 2025

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

  • @fairy6615
    @fairy6615 21 วันที่ผ่านมา +9

    This is such a good tutorial!! Just enough explanations on why we use a certain function or line in script for even a beginner like me to follow along. Thank you!

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

    This dropped just in time for me to redo my character controller after a flawed one I wrote a couple of months back... Will follow along shortly.

  • @TheFilipFonky
    @TheFilipFonky 26 วันที่ผ่านมา +13

    One thing to note: by default Godot uses the negative Z axis as its "front-facing" axis, so you'll want your character models to face that direction when you make them in another program. This is why, for example, you had to rotate everything you add to the scene by 180 degrees.
    EDIT: it's also why you had to use BACK to invert the direction's vector. Basically your character is facing backwards, and instead of turning it you're turning everything else you create afterwards, which is a bit fiddly.
    EDIT2: also you seem to have skipped a lot of pages when it came to the animations. You went "I already have these move() functions made" and glossed over the whole thing.
    I still managed to obtain valuable information, and for that I thank you, but I had to do a lot of fine-tuning on my side to get it working correctly.

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

    GDQuest has been one of the best resources for learning Godot and in-general game development knowledge. GDQuest is truly one of the biggest and best-est contributors to helping beginners and intermediates improve their skills. Great work GDQuest and Crew! 🙂

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

    THANK YOU SO MUCH! I just started learning Godot (As well as programming in general) and I've been trying to make a 3D Character Controller for DAYS! This literally couldn't have dropped at a better time!

  • @TheLoneBit
    @TheLoneBit 29 วันที่ผ่านมา +4

    If the inverted Y is throwing you off, on line 76 of the player_3d_template simply change the += to -=
    Then you will look up with you move your mouse up and down when you move it down.

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

    Man, i can totally see me coming back to rhis video, i just thankful that we have such high quality godot content ;)

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

    I bought all of your courses, you are doing a great job!

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

      Yup, they are some of the best out there!

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

      We're so glad to read this. It's been a year of nonstop work and it's not about to let off so thank you!
      Your opinion may also help others look up the difference between GDQuest courses and other resources available out there for gamedev.

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

      @@Gdquest the explanations are really good. It's rare to see courses like that. I tried two Unity courses in the past and stopped because they were too technical and it was hard for me to follow along

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

    The quality keeps getting better~Great job!

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

    I have already got the great godot 4 starter kit and I have to say I am loving it (Quite possibly the best game dev tutorial series ever) but waiting for new tutorials is always a bit frustrating (not that I want the tutorials to be rushed EVER) but mini tutorials like these that actually showcase how to do just one mechanic rather than an entire games is quite possibly the best way to spend time as I wait for new modules. If you guys are comfortable doing this I would probably not be able to miss an upload from you guys ever.

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

    Look who's back in the house .🔥🔥🗣🗣

  • @greyly_
    @greyly_ 14 วันที่ผ่านมา +1

    12:26 I don't think you want to multiply by delta here. There is nothing time dependent about mouse movement. When the player moves the mouse a certain distance on their desk, that should always rotate the camera a corresponding angle, regardless of how fast or slow they moved the mouse (unlike a joystick, where time does matter).
    If the game can keep a perfectly steady frame rate, the player won't notice the multiplication by delta, since it's basically a constant at that point, but if the fps starts to fluctuate, camera control can feel a bit off.

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

    Just found your channel, genuinely a shame that your views aren’t in the millions. Maybe in 5 years they will be!

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

    We're so back

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

    Thank you so much! This was very helpful!

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

    This is a beautiful tutorial, the best, simple, 3D character tutorial I've seen, thanks for sharing. Also when following along with my own project (not using your project files), at 26:37, inside of the lerp_angle() function, I had to use _skin.global_rotation.y rather than the shown _skin.rotation.y, I don't fully know why, but if I didn't, my character mesh would rotate at the speed of light.

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

      THANKS

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

    I had a perfectly working character controller for the player, but it was handling the player velocity and acceleration by lerping the values. Not a problem per say. It worked just fine and without issues and there was no need to re-do everything. But I desperately wanted to attach the velocity and acceleration to move_towards() function for a slightly different acceleration method, but no matter what I tried, I couldn't make it work. Followed a couple of tutorials just to refresh my brain on how other people build their player controllers and none of them would work well enough. All of them causing jittery movement at low FPS values.
    My project is capped at 24 FPS for aesthetic reasons and then I find this bit here. All fresh and new and it has the answer to my problem. Now my player controller has a shiny new movement script which is based on what you did on the video here and it works even better than the one I had before. I mean, it feels the same while you play and nothing seemingly has changed, but the lovely numbers being printed in the debug box tell a different tale.
    Thanks, man! Amazing tutorial.

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

    Nice to see you again

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

    Nice! Can't wait to dig into this one! Thank you so much!

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

    a good explanation on the directions
    ty

  • @mercurio-jx2wc
    @mercurio-jx2wc 2 หลายเดือนก่อน +4

    Congratulations on the success of your game brotato... you deserve it!

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

      GDQuest didn't make Brotato but @blobfishdev who did, would most likely be glad to read this! It's kind of you to congratulate others on their successes. Thanks!

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

    For when I begin my Game's Timeline Series in 3D, I'm using Godot 3D so these videos are really helpful

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

    Very nice. Looking forward to see you at GodotCon 😊

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

    The GOAT is back!

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

    This tutorial is unbelievably good. 👌
    Thanks

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

    THANK YOU!

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

    I love these characters

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

    28:03 move_and_slide() does not work as expected if there is no gravity. At this point (before adding gravity), if we set the speed to 9.0, the character is no longer going down the stairs, but floating in the air.
    Thank you)

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

    Wow!! Good stuff!!

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

    Such a good video, dropping a like for the algorithm lol

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

    Amazing!! saved me so much time

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

    Oh lol I didnt know that this video just was upload yesterday. Today I just searched this and find a very good course

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

    Was missing a new video! I wish I can have some time soon to fully watch it ❤

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

    Thank you so much! A video like this make me stick to Godot. XD

  • @Mr_Blobby_
    @Mr_Blobby_ 19 วันที่ผ่านมา +3

    if is_camera_motion:
    _camera_input_direction = event_screen_relative *
    it doesnt work, it shows that its a error

    • @lolzor96
      @lolzor96 8 วันที่ผ่านมา

      Same here. Not sure what I'm missing

    • @lolzor96
      @lolzor96 2 วันที่ผ่านมา

      Hey so, I managed to solve this. I replaced event_screen_relative with event.relative. I'm not sure if that introduces any issues but it seems identical in function from what testing I've done

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

    Perfect timing, just wanted to try out making a 3D Game :D

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

    Great Tutorial, hopefully , I can learn enough to make a cool project using this stuff, but for now, I will try to create another 2D Project while learning what I can.

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

    Probably a dumb question, but I'm a little confused on why the mouse_mode == MOUSE_MODE_CAPTURED is there. In the video you mention it's to stop input from passing to the window when it's not focused. But unless I'm missing something _unhandled_input, or just _input for that matter does that automatically?
    Edit: Also I sanity checked thinking maybe Godot changes Input.mouse_mode when you unfocus, but printing it in _process it's still MOUSE_MODE_CAPTURED. So I'm confused how that code does what was said in the video. Is it actually there as an extra layer against overriding UI inputs ?

  • @YeomasBros.2008
    @YeomasBros.2008 หลายเดือนก่อน

    I’m not much of a Godot person but…we believe in Sophia supermacy

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

    what a great time fo this tut

  • @EspinosaDiego-up6zq
    @EspinosaDiego-up6zq 6 วันที่ผ่านมา +2

    SpringArm3d doesnt work for me, and idk what i gonna do to fix it, help
    🙃

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

    I search for this and "posted 1h ago" its made for me?? lets goooo

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

    Hey gdquest could you make a videos about how to make NPC with dialogue and cutscenes, it a fairly under looked subject in Godot video

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

      We definitely teach this in the GDQuest 2D course curriculum already but not in a video tutorial on YT. It typically uses resources or other advanced data structures so it wouldn't be a tutorial that would be beginner friendly if that's what you're looking for. We hope to get to make one some day either way.

  • @hlmpf
    @hlmpf 19 วันที่ผ่านมา +1

    great vid but why is there always a : before the = ? is that like default godot syntaxing or... also the movement decelarating naturally feels glidy. how can i make it more accurate to key releases?

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

    This was super helpful. Thank you 😊. I got super confused on the target angle bit. I didn't understand the signed angle to but and what that did haha. And the jump bit was so confusing, how come we had to set velocity y to 0? Is it possible to use a set up similar to the character3d template script when applying gravity when is not on floor? If that makes sense. I have a lot of learning to do lol

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

    please bring a tutorial on turning this into multiplayer

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

    Awesome tutorial, and just in time! Question: Is there a reason why you would want to rotate the skin and not the whole character?

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

    Hello again, thanks!

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

    Or you can just use a template for third person

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

    OMG thanks!

  • @FallenAshes-DaGamer
    @FallenAshes-DaGamer หลายเดือนก่อน

    im VERY new to godot, but i have an excellent understanding of scratch, so i know kinda how games can work in theory, so, correct me if im wrong, but can you add a character body 3d to the player then add a rigid body 3d to it (without interacting with the player physics) so it can interact with objects?

  • @manancialgd.
    @manancialgd. 29 วันที่ผ่านมา

    Nice video, buy you should probrably adress a good Design Pattern to go with the character controller. I usally use Strategy Pattern. Which one would you recommend to Godot?

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

    I don't understand. The .screen_relative property used in this video with the InputEvent.... it doesn't exist

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

      im with the same issue, my godot is a bit older than the video but is still the godot 4. i cant make the code work because the screen relative returns as invalid
      edit: solved, the issue was the version

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

      change screen_relative to event.relative
      if is_camera_motion:
      _camera_input_direction = event.relative * mouse_sensitivity

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

    Do you have a video on how to make a 3d character model for Godot. Same physique and size as the one character you're displaying rn

  • @Blender.Quebec
    @Blender.Quebec 3 วันที่ผ่านมา

    How can you come up will all this code by yourself ?

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

    also when we use a Godot addon do we have to give the creators credit?

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

    I decided to download the sample project and see if I could replicate what I call '3rd person MMO' camera and movement. I changed the mouse capture and mouse uncapture to right click pressed and released respectively, that feels nice but I can't figure out how to get the character to move forward when both mouse buttons are pressed.
    Also, are you right-handed? I have a theory that non-lefties never think to use the arrow keys as inputs, curious if this holds water xD

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

    For some reason, when using lerp_angle to smooth rotation, the character constantly spins forever. Any ideas? Great tutorial btw!

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

    anyone knows how i would make the character move slower left and right and move faster forward? or does this code only work by multiplying the move direction with a single value ? as soon as i write "velocity = velocity.move_toward(move_direction * Vector(1.0, 0,0, 2.0), acceleration * delta" it does something kinda funky to me, so when i turn ingame by 90% and walk forward the z velocity is still only 1.0 but it should be 2.0 no matter where i look? when i google this i only get results how people dont want different speeds depending if they move sideways or forward/backward so i'm kinda lost here :(

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

    what can cause that with spring arm I can go under a gridmaplayer surface?

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

    How can i fix the camera not following my character? I can move my camera and character but it doesnt follow my character, I did use a different model though

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

      i fixed it, i just reparented the camera pivot to the player3d child, yippee!

  • @QuantumForgeStudios.Official
    @QuantumForgeStudios.Official วันที่ผ่านมา

    Hi! Could you please create a video tutorial explaining how to add a custom scene as a new type in a Godot plugin, while keeping the internal script hidden from the users? For example:
    I am currently working on a plugin for Godot that adds a new custom node type. I've created a scene with multiple subnodes and an attached script. Following the official tutorial, I've set up the plugin configuration, which includes a plugin.cfg, an icon, and a script.
    While I'm able to add a new node with the plugin, it's only adding the script and not the scene. I need help figuring out how to register the scene properly so that it's included with the custom node type without exposing the internal script to the users.
    It would be a massive help!

    • @Gdquest
      @Gdquest  วันที่ผ่านมา

      There is no ready made solution for it, unfortunately. You should create another custom node that loads the scene and adds it to the tree.

    • @QuantumForgeStudios.Official
      @QuantumForgeStudios.Official วันที่ผ่านมา

      @@Gdquest Hi! I need to register a scene as a custom node using the Godot plugin system, but I don't know how to do it. Could you please create a video tutorial explaining the process? Thanks!

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

    Fire tutorial I cap you not.

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

    Why are you doing the camera pivot movement in physics_process instead of just process?

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

      @@lolaccbroj1 consistency, otherwise input feel would be tied to framerate

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

      @@Thomas_Lo Maybe im dumb but isn't that what delta is for? we could do this code in process and multiply by delta so it's not tied to the framerate?

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

      @@lolaccbroj1 you are not stupid, ofc you would use delta and thus get somewhat consistent behavior over a range of framerates. problems arise when there is stutter in the framerate or generally a slow down. Input delay goes up and so the input feel gets, well, bad. That's the theory. Incidentally it seems like Input polling is still in fact tied to the render thread in Godot. Just looked it up. My argument still holds true for physics based movements, but the camera could certainly be handled separately. I hope I am making any sense at all.

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

      Here, the camera movement is in physics process for simplicity. In Godot 4.3, on monitors with high refresh rates, moving the camera in the process loop can make it feel a bit smoother. But I prefered to show this simple approach and wait for physics interpolation, which is coming for 3D in Godot 4.4 I believe. Because even if you move the camera in the process loop, if the character moves in physics process, the character and camera motion will be slightly disjointed. You'd probably also want to interpolate the character position in _process(), and the code would be a little less straightforward for learning.

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

    The project is supposed to play sounds... at least when the player jumps. But to me it makes no sound at all!
    Is it normal?

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

    Cool

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

    Hello, excellent tutorial, to the point and super easy to follow AND understand.
    Still, my model flickers between its correct animation/pose and a mirrored-oriented version of it. Everything seems to work except for this.
    The faulty part of the code, on my end:
    if move_direction.length() > 0.2:
    _last_input_direction = move_direction.normalized()
    var target_angle := Vector3.BACK.signed_angle_to(_last_input_direction, Vector3.UP)
    _skin.global_rotation.y = lerp_angle(_skin.rotation.y, target_angle, rotation_speed * delta)
    I am not too sure what to change here, anyone with a problem like that?

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

      Yeah i got the same problem idk why

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

    Hi! could you do a small combat system tutorial? that would be really helpful

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

      Hi! Could you please describe the type of mechanic have in mind so I could take some notes? (Type of game with some references, whether you're referring to controls or enemy behavior, etc...) Thanks!

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

      @@Gdquest Gonna hijack this because I have the same request. :) A lot of tutorials exist for shooting combat, but I haven't seen much in the way of melee combat / combos in 3D, things of that nature. Something like Kingdom Heart's Sora's combat would be super helpful, though that is obviously well beyond the normal scope of a tutorial. Basic enemy AI utilizing a combo type combat would also be super helpful, but that would probably be a bit more advanced.

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

      ​​@@GdquestSorry for the late reply! I'm looking for a hack and slash, bow and arrow mechanism(Botw) and climbing onto the backs of large enemies(shadow of the colussus)

  • @-mixu-
    @-mixu- 2 หลายเดือนก่อน

    Please, do a video about VisualSky scripts, it's a pain to convert something you do on blender into godot because all the peoples just do it in code
    It would make the process far more easier ,v,

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

    how do I make prototype levels like this one?

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

      In this case the level is made out of CSG nodes

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

    So… anything close to KH2 level of controls yet? :P

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

    Hey GDQuest, im trying to make a homing missile on godot 4.3 and im a beginner but no one has a recent video about this its super frustrating and i think you guys will listen so please make this tutorial a reality :(

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

      Hi @JeanJuniorJams We teach this in our upcoming 2D course as part of a module on Tower Defense. We haven't made a free tutorial about it yet. We currently have our hands full and the next few free tutorials already lined up.
      I took some notes but I don't know if we will get to it. It's also not a beginner friendly tutorial as it requires significant background.

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

      @@Gdquest well thats pretty frustrating: |

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

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

    crazy

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

    Gd script corues in Hindi language please sir 😢

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

    Godot is dead! Long live Redot!

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

      Code is the same, you can follow all the same tutorials. Have fun learning!

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

      not dead though :)

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

      Godot Still Useful its a Tool.

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

      Too bad Redot is a scam

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

      You took time out of your day to post this. Go make a game or something

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

    Even you people gave up on godot. Its a dead engine. With no serious game made with it. Everyone uses unreal. Its the best.

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

      shut up🤫

    • @CheezyPumpkin
      @CheezyPumpkin วันที่ผ่านมา

      Ever heard of this funny lil game called Buckshot Roulette?

    • @kayag8
      @kayag8 วันที่ผ่านมา +1

      @@CheezyPumpkin its a silly steam game, one of thousands of indie games.

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

    Your channel is a perfect match for our Megacity Low-Poly Asset Pack! Check your email inbox - we’d love to discuss a collab with you!

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

    Thank you so much for this great tutorial!