Make your first 3D Platformer in Godot 4: Setup, Movement, and Camera Controls
ฝัง
- เผยแพร่เมื่อ 25 มิ.ย. 2024
- 🔗 Code link: gist.github.com/bramreth/d963...
📰 Check out my Godot 4 course sale here! itch.io/s/99395/how-to-make-a...
✨ Socials ✨
🐦 Twitter: / bramreth
💬 Discord: / discord
🥰 Patreon: / bramwell
🎮Games: bramwell.itch.io/
Chapters:
00:00 Introduction and setup
01:24 Creating a 3D scene
03:24 Creating simple shapes
08:52 Graphical Settings
11:20 Supplemental Material
12:16 Creating The Player Character
15:10 Writing a movement script
22:55 Adding input events
25:17 Listening to four input events
27:38 Camera Controls
31:55 Listening to mouse inputs
33:56 Storing mouse motion
38:04 Using the twist_input
40:38 Using the pitch pivot
43:22 Creating node variables
44:55 Handling degrees and radians
45:45 Moving and the camera
47:40 Wrapup
#Godot4 #GodotEngine #Gamedev
It's rare to find a tutorial that really understands just how new its audience members can be. This was really well done, thank you!
Agreed!
agreed
yeah he explains every bit of code and guides us so well so we dont get lost. Wonderful tutorial
agreed!.
Yeah, it's really annoying having to pause the tutorial every 10 seconds, even if it's a really good tutorial. If this video had 20 minutes with the same content, it would still take me like an like 40mins to go through it. I really appreciated just going along the tutorial without having to focus that much to not miss something.
As a unity refugee this is very useful
As a Godot beginner i approve of this comment
Lol same, just jumped on to Godot.
Same
Same case here
me also...
Someone may have already mentioned this, but Godot 4.1.2 changed Input.set_mouse_mode(Input.MOUSE_MODE_"whatever") to Input.mouse_mode = Input.MOUSE_MODE_"whatever"
for me the old way still works
Man you're the only person I could find who showed how to make a floor mesh without going through 40+ minutes of video first. Thanks so much.
In 4.2+ "Lock rotation" is under "Deactivation" in RigidBody inspector.
You're doing the lords work
Thank you, I bet people will be coming to this comment for a while
I just want to say, my brain likes the pacing of your tutorial. And you have a dope voice for it.
Props to you for making this.
bro, just unity was an great engine ._.
@@TheWorldofMO :(
I tried learning Unity, then all of the stuff that happened happened, so like I guess Godot was the best choice as I had some level of experience with it on my old computer, but I don't remember a lot so....@@TheWorldofMO
I found this to have a great pace and level of detail for me. Your editing and commentry are also excellent. Thank you.
As a complete noob I have to say this is the best tutorial I have bern through! Please, please do more!
Awesome Introductory guide, helped me start porting a project from Unity over to Godot after the ongoing debacle with that and this really helped me get a hand on the programming workflow for Godot. For other people who just went through this walkthrough you can make diagonal movements more consistent by normalizing the input Vector by adding '.normalized()' to the end of it, this makes your diagonal movements the same speed as your horizontal movements prevent diagonal running by faster. Thanks Bramwell for doing god's work.
Thanks this tip was really useful.
Dude this is a really well-made tutorial! You explain everything so well and it doesn't feel too fast or too slow.
Really good job Bramwell.
Only issues I have are:
If you're using a character mesh that isn't a capsule etc, then you will be able to see that the character does not rotate toward the camera direction as the tutorial stands.
Abstracting the raw numbers to a variable is good code practice, creating a move_speed variable for instance.
Adding a springarm as a parent of the camera (but still a child of the pivots in this case) is also good practice, as it shouldn't allow (or at least make it less likely) that the camera will clip through objects in the game world.
The input direction should be normalized to avoid being able to travel faster than intended in diagonal directions, otherwise the inputs are added together.
As a rigidbody is being used, the actual movements should be handled in _physics_process
how do you make the player rotate with the camera?
@@000-chatGPT basically by rotating just the mesh and not trying to rotate the whole player, I played with it for a long time but rotating the mesh towards movement direction is the only way I can find right now, I'm actually working on my 3d platformer project now so I'll copy and paste some code in a sec
@@000-chatGPT
input_direction = Input.get_vector("left", "right", "forward", "backward")
if input_direction != Vector2.ZERO:
# Calculate movment direction
movement_direction = yaw_pivot.transform.basis * Vector3(input_direction.x, 0, input_direction.y).normalized()
# Rotate mesh toward movement direction
gobot_mesh.rotation.y = lerp_angle(gobot_mesh.rotation.y, atan2(movement_direction.x, movement_direction.z), delta * rotation_speed)
# Move towards input direction
velocity.x = movement_direction.x * move_speed * delta
velocity.z = movement_direction.z * move_speed * delta
else:
# Slide towards previous input if there is no input.
velocity.x = move_toward(velocity.x, 0, move_speed)
velocity.z = move_toward(velocity.z, 0, move_speed)
move_and_slide()
@@scorpi0uk thank you so much i’ll try it now
Just started the video and already I have to say I'm liking your style of explaining things in a concise, yet detailed manner. Seems to be very thorough while being easy to follow for a beginner.👍
Thank you for taking the time to make this, it has been extremely helpful
So... we're all here after the BS pulled by Unity the other day huh 😂
Yep, that explains it
Everyone is saying Godot is easier to learn than unity, but it seems a lot more complex to me.. I was just beginning to learn unity and decided to try Godot out as well. Am I the only one who prefers Unity over Godot?
@@thatcardiologist3874 me too, but Unity is not a viable option for most people now
@@thatcardiologist3874there is a difference Godot already has a scripted written. And unity you need to add the #C script your self so it really is which one you know how to use
@@thatcardiologist3874no... I prefer unity because its easy but i quitted unity because latest news
No disrespect to other helpful creators out there but I've been following loads of godot beginner tutorials, and this guy here is the best by far.
He knows how to teach. He's probably a professional teacher.
the way he explains every bit of code and guides us so well so we dont get lost. Wonderful tutorial and one of the best out there
Awesome tutorial! Easy to follow. The depth of explanation was just right. I’ll be checking out your other stuff for sure.
Hey man, thanks for this amazing tutorial. I've been an 3D Animator my whole career but for my free time I finally want to get into creating a few of my own games, of course a bit smaller in scale.
It was really easy to follow along and you always came back and explained the code we were writing which is super important for me. (I followed other tutorials before and I always kind of accepted "guess this is how it works and I am just not smart enough to get it.") I never coded before, have been severly convinced I am bad at math und it seemed like dark magic but now I look at this little pill with 3D camera and feel proud and smart. :)
Will definitly check out your other courses. Cheers!
Wonderful tutorial! I'm very new to game development and I was finding myself becoming very discouraged after attempting a few other tutorials and getting super overwhelmed. This one was easy to follow along with, and I really appreciate how you explain in so much detail, rather than just giving us steps to copy. Will definitely be checking out the course.
this is a godsend. so glad to see high quality tutorials for godot :)
This is so well explained, woah! I like how you explain everything in detail its super helpful
Honestly one of the best tutorials I've seen. Really clear and well paced. Also the editing is clean and really helps to understand what's going on. Please keep them coming, definitely going to purchase your course once I've got the hang of this!
Thank you!
This is very solid. I really appreciated the zooming and screen animations to highlight what you are doing
Amazing video man. Loved the amount of detail you included and your clear instructions.
This was a fantastic tutorial! The pacing was perfect for easy following and everything worked as advertised. It's just what I needed to finally get a start on my project and will provide a great foundation to build up from.
Thanks!
please continue this series! i bet many will love this like me!
incredible tutorial! Please continue making them! 🥺
Excellent work. Very well done, and will purchase the course. Please continue the video series too!
thank you so much man this really helped me its rare to find someone who actually explains how everything works
I am currently working on a 3D-world grid-less turn-based RPG and this tutorial has been incredibly helpful in setting up the basis of what I am working towards. Thank you so much for this tutorial, you have no idea how helpful it has been!
Please continue with these videos. Very well done,. Well paced and clearly explained without going in to too much detail straight from the get go. Perfect for me. Thanks a lot.
The way you paced this video, and the contents, is pure gold...⭐⭐⭐⭐⭐
You Don't Know How Much This Helped Me!
Really appreciate the tutorial! I was feeling reaaally intimidated by learning gdscript and getting into godot in general as a beginner in game development and this made it feel so much better!
a beautiful and perfectly done tutorial. Everything is explained clearly, and very easy to follow. Thank you so much!
This was exceptionally well put together. One of the clearest and most helpful tutorials I've ever watched in general. I've worked in GameMaker for years now, but am considering how feasible it'd be to work in 3D in Godot in the future. Even though I didn't "follow along" with the engine open, I now have a really good sense for how Godot operates and it's actually pretty damn exciting. Definitely keen to give it a proper go now and see what I can russle up through prototyping at some point!
same! Worked in gamemaker since overmars released it, way back in the stone age - totally agree with you on his presentation. It's gotten me back into it for sure
dude this is feckin amazing. i have learned a lot from this, already expanding my knowledge on godot... added sprinting and jumping. chance i may have found doing so easier being a unity dev for 10 years but this has helped me learn this engine
edit: fov broke, don't know what i did
Amazing tutorial. Information dense, yet easy to follow.
You explain it so well! I've been following you on my Godot!
Thank you!
I really appreciate how slow and steady this tutorial is. Exactly what I needed. Cheers to Day#2 of learning game dev !!
Me to
That was clean and concise. I really learned some basic things I should have known a long time ago. This helped me get over the "this doesn't work, now everything sucks and this shouldn't be this complicated" bump
A very nice edit, accompanied by a very entertaining commentary. In addition to this, the tutorial is very well done, guiding the viewer step by step to achieve his goal, a really nice video!
Amazing tutorial, thank you!!
This is far and away the best guide I have found. I look forward to learning more from you.
jesus this is SO MUCH better than a lot of other godot tutorials, especially a lot of those weirdly high production value ones that YT pushes to the top of search results but are outdated and unclear. thank you so much for making this!
Thanks for the great tutorial. I've been doing something similar recenly, so here are some notes:
14:35 Why not use the "capsule" shape directly? It should be more performant in theory.
14:50 I've had an issue (climbing slopes) with this one and opted to instead lock all 3 angular axis, maybe it will help someone.
17:05 Isn't it better to just call them "built-in functions"? In terms of "virtuality", you can override the user-defined ones as well.
19:50 It is potentially bad to apply physics-related interventions from the "_process" callback. You could switch some internal state from "_process" and then apply force in "_physics_process". Or just set the "constant_force" from "_process", so that the physics thread can apply it when it pleases.
thanku :D for the slopes issue!!!
callbacks
This is a fantastic tutorial, have learned a ton about Godot, and inspired on various approaches to improve my own tutorials. Great stuff!
Thank you for the awesome tutorial! Godot is underappreciated.
Simply perfect. Right speed for a beginner, well explained. Subscribed.
Great tutorial! Looking at buying your course!
thank you so much for linking the code in the description so we dont have to meticulously type out every character, it helps alot
Fantastic Tutorial! Great Work!
Thank you man. Very hard to find a tutorial that is easy to follow
one of if not the best intro tutorial i've experienced god damn
My god, finally someone who told me how to do the mesh on the ground!! I was dying trying to figure it out. Subbed and liked, best tutorial by far.
What an utter gem of a channel. My game dev skills are so rusty they may as well be non-existent at this point. This was a fantastic and succinct tutorial to get anyone up and running fast. I learned some new tricks too!
Really nice tutorial! Thank you for such a useful introduction to godot 4
This was the best getting started video for godot I have seen!
Dude, this is the best Godot 4 Tutorial I've found so far.
Thank you very much !
Great tutorial - well done!
thank you very much for this video, this is the exact kind of camera style i want for my game, and even if i did find one like this before, all were outdated, so thank you
honestly I love your tutorials super easy to follow;
thank you very much :)
Came here after the Unity install-fee debacle. This is an excellent introduction to Godot for someone coming from Unity. Thanks a lot :)
i love seeing greed get punished, delicious tears of the people who pushed this idea. was it the board or ceo idk, but whoever it was must be shitting their pants now lol
same, you trying out different alternatives other than godot too?
I am loving it so far. Unity is toast.
@@sourlesscream1272 I've dabbled with Unreal over the weekend as well. Right now I feel:
- Unreal is a superpowerfull piece of software, but has 'it's way of doing things' (I have an existing charactermodel and animationrig, and haven't been able to get it to work as of yet)
It also has a whopping 36 gig install size, and my pc doens't run it super smoothly..
- Godot is super lightweight, but with a lot less functionality. (for 3D games at least)
With this streamlining comes more of a 'you figure out your own way of doing things' kinda approach, which I appreciate. With help of this wonderful video I could make a simple 3D platformer with an animated character in a couple of hours :)
Also my pc runs Godot a lot better than Unreal.
It's also open source and a non-profit organisation, which in todays technofeudalistic economy gives them 100 bonuspoints in my book :)
So yeah, I'm currently leaning towards Godot. How have you been getting a long?
Everyone is saying Godot is easier to learn than unity, but it seems a lot more complex to me.. I was just beginning to learn unity and decided to try Godot out as well. Am I the only one who prefers Unity over Godot?
This is super easy to follow and super helpful as well
Thanks a lot my man
Great tutorial! I'd love to see more videos like this on Godot.
Thank you for the course. A very detailed explanation. Bought it
Thankyou so much for the support!
Same, world class Godot course and tutorials - please keep up the amazing work!
Great video, very comprehensible, great pacing, and great explanations.
This vid is edited uniquely superb. Thank you!!
Yeah this is a really excellent tutorial. Like a few other commentors, I'm a Unity refugee and I super prefer this level of deep explanation about even the most simple concepts, it's so helpful to properly understand the tools.
Thanks!
(Also saw a semi recent 4 dev Game Jam of yours, kicked ass)
So glad to see a rigidbody controller tutorial rather than kinematic. Excellent material, thank you!
this is really really well done! and Ive watched / read alot of tutorials. thank you! I can finally make my blob wander through my wonderful 3d assets :-)
Amazing tutorial. I cannot describe how helpful and thorough this is. Thank you, sincerely.
Very well put together video. Thank you
Exceptional Video and Brilliant commentary. Thank you for all the help!
This tutorial is perfect, both for beginners and regulars. Thank you🙏
Nice one! Thanks for this.
This is an amazingly instructive video, thank you for making it.
Amazing Video and straight to the point while ensuring everyone is following along. these are really that style of videos that i need. thank you so much. Only really introducing the things when they are relevant and giving a brief but yet detailed explanation on the things.
Thank you a lot for an amazing tutorial!
best beginner tutorial ever, thank you!
incredibly concise and calm
Thanks a lot for the tutorial. Just what I needed.
You speak really well and your teaching method is very effective. Thanks for the video, I'll be following you! Another subscriber.
just a great Tutorial you did there, that was not my first time of godot. But at the first Time i wasnt doing it properly so now i wanted to make a basic Project. Thanks again for that great Tutorial
This is a fantastic tutorial for a beginner like me. Switching from Unity to Godot feels like magic to me (ironically). I now consider Godot as my second home. Thank you for this wonderful tutorial.
Great video, really clear and concise.
I have a lot of trouble understanding and picking things up, especially coding but this video explained it in a way that while still a bit confusing (for me personally) was still able to interpret better than other videos, plus I've made more progress in the hour I've spent on godot watching your videos than the 2 months I spent following stupid Unity guides!
I really hope to see more videos because a video format is easier for me to follow than a written one (I have ADHD and a tiny bit of the 'tism so following/remembering instructions isn'y my strong suit) but thank you for making it so new user friendly :)
Your voice is relaxing and you're great at teaching. Keep it up!
Very concise and detailed explanation. 5 stars. Thank you.
Thank you so much !! It was very helpful!!!
10/10 tutorial for beginners, absolutely perfect for me as someone who has never used game engines or even done basic coding
At 45:30, instead of using deg_to_rad(), you can actually reference the degrees directly: "pitch_pivot.rotation_degrees.x". So you don't need to convert the clamped values to radians.
For me, it locks the pitch of the camera
@@lemmings1892 Here's the code I have:
camera_mount.rotation_degrees.x = clamp( camera_mount.rotation_degrees.x, -45, 45)
But take it with a grain of salt, I'm just a newb. It works for me and I did make some changes from the tutorial, I wanted more of a shooter-esque control scheme.
Thank you for this great tutorial!
adding comment half way through this is definitely very in-depth which is the kind of tutorial I like best especially if you using a program for the first time
amazing video, you really got a knack for this
Best starter 3D Godot tutorial I've seen yet. Thank you. I'll be buying the last sections too.
Some feedback:
In the code writing segments:
The slow detailed explanations was really good in most of the tutorial, except for in the code writing segments without lots of pausing and rewinding.
Please use one set way of writing the code and explaining - with steps - and tell us that this is how you will be explaining the writing of code at the start of the video, so it's a process to follow for learners each time a code writing segment comes up.
E.g. Brief overview of what the code is for, before-while the video shows it being typed. -> PAUSE (showing all of the newly written code) to let people copy it and take it in (pausing a couple of times could even be helpful) -> Then go over the different parts in detail.
I understand you can spam pause and rewind as much as you like, but sometimes there was just too much going on at the same time, descriptions and new code being added, with a cut to a new scene without time to process what's going on.
Why in this order?
When I've been doing these tutorials it has helped me learn to hear a brief overview -> copy the code myself, because when you're writing it yourself it forces your brain to figure out which parts are doing what and where the values for the variables are coming from, etc. Then the actual proper explanation of what's going on tells you if you're right or wrong.
Writing the code as a newcomer is also the most stressful part of learning game engines.
Making it more orderly also allows time for taking notes, as in the segments I was always back and forth over one sentence.
Thx again. :)
This helped so much, thanks!
I Appreciate this SO much, I found a "Movement tutorial in 6 minutes" and I just didn't understand anything and the Userguide, even though I followed it to the letter became super non-explainy(?) Your voice is also Extremely nice!
Nice and chill, conductive to learning.
Awesome work thank you!