Godot 4 Sourcelike FPS Character Controller Tutorial | Smooth Movement, Bhop, Surf, And More

  Рет қаралды 2,858

Majikayo Games

Majikayo Games

Күн бұрын

The first video of a series where we will build an FPS game. This video shows how to implement source engine like movement mechanics.
STARTER PROJECT: github.com/majikayogames/Simp...
Full Playlist: • Godot FPS Tutorial
GitHub Repo: github.com/majikayogames/Simp...
All source code and included assets are licensed under the CC0/public domain license.
Dot product interactive web demo used in the video: majikayogames.github.io/dot%2...
How Godot's Transform3D Type Works: • How Godot's Transform3...
Contents of this video:
0:00 - Basic setup
3:20 - Hide player model from player camera
4:36 - Aim with mouse
7:57 - Basic movement, jump, gravity
16:00 - Headbob effect
20:10 - Auto jump & input actions
21:28 - Gamepad/controller aiming support with smoothing
25:12 - Advanced air movement/strafe
31:24 - Advanced ground movement with friction/bhop
35:32 - Surf with clip_velocity
40:31 - How to make surf ramps
42:30 - Outro

Пікірлер: 40
@MajikayoGames
@MajikayoGames 11 күн бұрын
Hi everyone! Thanks for watching. If you enjoyed this video, make sure to check out the full FPS tutorial playlist where we will add many other features to the FPS controller we built in this video. Full Playlist: kzbin.info/aero/PLbuK0gG93AsHID1DDD1nt4YHcdOmJvWW1
@Potato6153
@Potato6153 20 күн бұрын
You are quickly becoming one of the best tutorial creators, as You are going very in depth and it's great not only for beginners
@Jetiix
@Jetiix 11 күн бұрын
Amazing work, your solutions are much more elegant than mine, with the same principles! You are a real pro at this! I tried to make the crouch jump by moving one collision box into another, and the stair stepping with an area cast, but they were both really buggy, your tutorials have been helping me a lot, I hope your channel grows a lot.
@MajikayoGames
@MajikayoGames 11 күн бұрын
Appreciate your comment! Glad you enjoyed :) I'm gonna be making a lot more videos so hopefully people will continue to find my tutorials and code useful.
@fluttershy3642
@fluttershy3642 20 күн бұрын
Are you serios, I've spent so long trying to code source style movment and failing. You're a god's send!
@MajikayoGames
@MajikayoGames 20 күн бұрын
Glad I could help :D let me know if you have any questions about it. I'm also going to be doing some more videos soon to get sourcelike stair handling, ladders, water, and some more stuff.
@fluttershy3642
@fluttershy3642 19 күн бұрын
@@MajikayoGames Really intresting, will you try and get the ladder speed bost thing aswell? When you look up sideways on the ladder while holding (A or D) + W it dobbles the speed. You know what I am talking about? And isen't stair handeling usually just an invisible hitbox that is sloped for smooth ups and downs?
@MajikayoGames
@MajikayoGames 19 күн бұрын
@@fluttershy3642 I think I've seen videos of the ladder boosting, but I'm not 100% sure what it is. If you want, I can send you the current build of what I'm working with and planning on doing the next few videos on. Then you could tell me if it is correct behavior or not. My discord is @majikayogames
@blossomcherrypink
@blossomcherrypink 15 күн бұрын
​@@fluttershy3642 Bro you just reminded me so hard of CS 1.6 surf maps
@traumwelt1975
@traumwelt1975 9 күн бұрын
might be too advanced for me but thanks a lot for the share of knowledge.
@tedmosby1235
@tedmosby1235 19 күн бұрын
Ooooh nice bro ! helping a lot !
@Marandal
@Marandal 19 күн бұрын
Awsome. i love me some Source movement. Thank you Maj
@sinecure5
@sinecure5 20 күн бұрын
Excellent stuff, you're a great teacher.
@TRUFANATIC
@TRUFANATIC 19 күн бұрын
THIS IS INSANE
@Kolbiathan
@Kolbiathan 20 күн бұрын
You are a LEGEND! Thank you so much for your clear and in-depth explanations of these topics.
@tuxhome3686
@tuxhome3686 20 күн бұрын
Was looking to learn 3d in Godot, will be following this tutorial!
@saveborg1091
@saveborg1091 18 күн бұрын
i have a question... does the "hide child" by switching layer mask would let me setup a multiplayer game? i have this issue where I CANT find a way to hide myself and not the other player. Edit: fucking god this video it's insanely well done! the snippet codes explaination... for example what .basis it's litterally the best thing you could've done. PLEASE continue like this.
@MajikayoGames
@MajikayoGames 18 күн бұрын
Yes later in the tutorial series (which may take some time to get the videos out) we will use the layer mask feature to help us create a multiplayer game. What you would do here, is only call the code to hide each player's model, on their own machine in _ready(). You can use is_multiplayer_authority() for that, if each client is given authority over their own CharacterBody3D which is probably the approach I'll go with. Then, only the local player model will be hidden and the rest will be shown. You can also just set the nodes to invisible in _ready() depending on which client the code is executing on. Super glad the basis explanation was well received! Goal was to make it accessible to new learners.
@mirage3dee
@mirage3dee 15 күн бұрын
Wonderful content. Thank you for your time and effort.
@nataliereilly7895
@nataliereilly7895 15 күн бұрын
👍🏽👍🏽👍🏽
@RamS-xz6ku
@RamS-xz6ku 10 күн бұрын
Amazing vid rly helpful, do you think there would be a way to combine surfing and titanfall style wallrunning code ?
@MajikayoGames
@MajikayoGames 10 күн бұрын
Yeah this sounds like a pretty fun idea for a high skill cap movement fps game. I had a similar idea before. It's pretty easy to check when in surf mode. Probably just checking if clip velocity was called on a wall of some angle. Maybe some walls you can only surf, and others are too steep so you can wallrun, if that's what you mean.
@RamS-xz6ku
@RamS-xz6ku 10 күн бұрын
@@MajikayoGames yeah exactly provided you have enough momentum to wallrun but also are there any similarities between wallrunning and surfing logic
@MajikayoGames
@MajikayoGames 10 күн бұрын
@@RamS-xz6ku I haven't implemented wallrunning before, but I guess it would depend on how you implement it. Off the top of my head, with how I have this controller currently set up, maybe you would add a _handle_wallrun function like the others, which would run in the case of maybe having a sufficient amount of some wallrun which gets depleted, and exits right away if not is_on_wall() and the wall is not a correct angle. You could do wall_normal.angle_to(Vector3.UP) and wallrun if it's between like deg_to_rad 85 and 95 degrees or so. I would think wallrun code would be a bit different as you want the play to stick to wall more cleanly and not just slide based on gravity vs strafe as we do here. Could be a fun tutorial, I'll add it to my ideas list.
@RamS-xz6ku
@RamS-xz6ku 10 күн бұрын
​@@MajikayoGamesthx for explaining how i could go about it I'll try it out, looking forward to ur vids tho
@RamS-xz6ku
@RamS-xz6ku 9 күн бұрын
Umm also I noticed that if ur jumping forward in air and click the s key all your forward momentum just stops would there be a way for momentum to change more naturally? Edit nvm I'm dumb changing that makes it feel more natural yes but i can't do those fast look around boost things anymore so... Smh
@PastaMaster115
@PastaMaster115 9 күн бұрын
Is there a benefit to nesting your if statements instead of just using "and"? Especially if there isn't expected to be an elif or else.
@MajikayoGames
@MajikayoGames 9 күн бұрын
Nope no difference. Sometimes I do it in my own code if I feel it makes it more clear and easier for me to read, or if I'm planning to add some more code there later.
@raminkuntopolku8636
@raminkuntopolku8636 12 күн бұрын
How would one implement ramp sliding like in source games? Like when you hit a slant/ramp straight on at a high speed, you just keep sliding. Currently in this project the player character just slows down aggressively. Also it seems like bunnyhopping without airstrafes seems to slow you down because the friction is applied from the first frame you touch the ground. How could i make bunnyhopping conserve the speed i have?
@MajikayoGames
@MajikayoGames 12 күн бұрын
Not sure what you mean about bunnyhopping without airstrafes slowing you down. I'm not sure exactly how source does it, do they actually wait a frame before applying any friction? I though they just applied a small amount of friction each frame you're on the ground, so if you gain speed faster than the friction by air strafing, you can speed up. You can adjust the character's ground friction to change how this behaves. The issue of sliding on slopes, I'll make a note of that, I already have a similar issue here on github that I want to look into. Looks like a few mechanics depend on slope angle: github.com/majikayogames/SimpleFPSController/issues/1
@raminkuntopolku8636
@raminkuntopolku8636 12 күн бұрын
@@MajikayoGames I mean just hopping straight (simply holding space with autobunnyhop) should let you conserve all of your speed and not slow down a little bit each time you touch the ground. I don't know how source does it but that's what cs bunnyhop and surf servers feel like. I don't want to lower the friction since that would make the regular ground movement slippery right? and that wouldn't eliminate the issue completely either.
@MajikayoGames
@MajikayoGames 12 күн бұрын
@@raminkuntopolku8636 i think they just have less friction than this controller does by default. try lowering the ground_friction and ground_decel values a bit. yes it is more slippery but source games are more slippery than this controller by default too. also in source there is a different crouch friction which i didnt add yet.
@lethn2929
@lethn2929 2 күн бұрын
@@raminkuntopolku8636 I'm late to the the video but in case your looking for a bit more detail or anyone is wondering the character controller itself has settings on angles which dictate whether or not it can even slide on them and I found it was interfering with my attempts at implementing vent crawling awhile back, following settings will likely affect things a bit. . Wall min slide . Max Angle . Stop on slope boolean Hope this helps people
@gronko_chug_butter
@gronko_chug_butter 9 күн бұрын
Is there any reason to use the self keyword, or is it just for readability.
@MajikayoGames
@MajikayoGames 9 күн бұрын
nope it is implicit for all variables/funcitons in scope of current node but I like to put it there to make it more clear for myself personally
@jamesoneill4607
@jamesoneill4607 20 күн бұрын
What about those stairs though? 😁
@MajikayoGames
@MajikayoGames 20 күн бұрын
Tutorial for those should be out in a few days as part of this series :) have 1 short vid to make before that
Noclip For FPS Character Controllers - Godot 4 Tutorial
8:44
Majikayo Games
Рет қаралды 407
Smooth Up & Down Stair Handling | Godot 4 FPS Controller Tutorial
30:38
¡Puaj! No comas piruleta sucia, usa un gadget 😱 #herramienta
00:30
JOON Spanish
Рет қаралды 22 МЛН
100❤️
00:19
Nonomen ノノメン
Рет қаралды 37 МЛН
5 Games Made in Godot To Inspire You
3:48
StayAtHomeDev
Рет қаралды 23 М.
How to Use Quaternions
14:20
Positive Altitude
Рет қаралды 8 М.
Godot 4 Ledge Climbing tutorial
7:23
Brokencircuit
Рет қаралды 8 М.
Euler vs Quaternion - What's the difference?
8:49
Class Outside
Рет қаралды 31 М.
Godot's Quaternion Variant is Beautiful (and misunderstood)
18:52
INSANELY Smooth pixel ATTACK Animation Tutorial
18:54
Penusbmic
Рет қаралды 480 М.
Crouch + Sourcelike Crouch Jump | Godot 4 FPS Controller Tutorial
19:23
We made Vampire Survivors BUT in 10 Lines of Code
7:08
PlayWithFurcifer
Рет қаралды 955 М.