Тёмный
No video :(

FPS Character Controller in Godot - Make an FPS in Godot Part 1 

Code with Tom
Подписаться 13 тыс.
Просмотров 164 тыс.
50% 1

Опубликовано:

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 534   
@CodeWithTom
@CodeWithTom 4 года назад
Just to let you know there's a technical issue with the www version of the website right now, but you should still be able to access it at codewithtom.com. Apologies for the inconvenience and thanks!
@cwasunt9468
@cwasunt9468 4 года назад
Tom please help!!!!! At around the 17:00 mark my player only moves right! What could I have done wrong?
@cwasunt9468
@cwasunt9468 4 года назад
Nvm I figured it out
@gregorycandiotes4293
@gregorycandiotes4293 4 года назад
Myne says unxpexted error if pls help
@sirechubs
@sirechubs 4 года назад
My player keeps moving right, how do I fix that?
@sirechubs
@sirechubs 4 года назад
@@cwasunt9468 how'd you do it?
@user-wy7oh6tg1e
@user-wy7oh6tg1e 5 лет назад
Godot doesnt have many videos on youtube, so I really like that he started to upload videos
@CodeWithTom
@CodeWithTom 5 лет назад
Thank you! :)
@jackv7614
@jackv7614 4 года назад
7:25 THANK YOU! Making the text bigger is so simple that makes following along so much easier and yet it's something so many people overlook
@dubsidian6975
@dubsidian6975 4 года назад
Thank you for taking the time at the end of the video to go through almost line by line and recap what the code does and how it affects the project, a lot more presenters could benefit from this, it's very helpful to a novice of programming. Great tutorial, easily one of the best I've seen on RU-vid, especially for Godot.
@CodeWithTom
@CodeWithTom 4 года назад
Thank you for the kind words, I really appreciate it
@leeramer171
@leeramer171 3 года назад
@@CodeWithTom I 100% agree, I like your summary on everything you have taught during the tutorial. Everything is very well explained, pace is excellent, very much appreciated.
@CodeWithTom
@CodeWithTom 3 года назад
@@leeramer171 thank you Lee I really appreciate it 😁
@mezzowatt
@mezzowatt 4 года назад
This is the first Godot video which I actually understand - I didn't need to replay anything to understand what was going on, not to mention the fact that you started on a blank project instead of using a premade one. Thanks a lot!
@CodeWithTom
@CodeWithTom 4 года назад
Thank you for the great feedback. I'm really glad you were able to follow along! :)
@johnnygossdev
@johnnygossdev 5 лет назад
I've always thought 3D was a little beyond me a tthe minute but I dare say Tom, you are convincing me otherwise! Great tutorial thanks so much!
@CodeWithTom
@CodeWithTom 5 лет назад
If you can make a game in 2D you can make one in 3D. Give it a shot, I think you'll surprise yourself!
@sykoo
@sykoo 5 лет назад
This is fantastic man! Keep up the great work on these videos. =)
@CodeWithTom
@CodeWithTom 5 лет назад
Thank you so much man! I've been a huge fan of your channel for a long time now so that means a massive amount!
@romanglinnik8073
@romanglinnik8073 4 года назад
Hey Sykoo
@shwetanksingh2156
@shwetanksingh2156 3 года назад
What are you doing here ????
@thomaseubank1503
@thomaseubank1503 3 года назад
Thanks for the video, got it all down. My only mistake was typing action_just_pressed instead of action_pressed. All in all I really like the pace. You do not go so fast that I have to rewind constantly like other youtuber's tutorials.
@tsk5328
@tsk5328 3 года назад
hi total novice here but I use the youtube video speed functions for those videos where the passing is to fast or (very rearly) to slow. After I saw a friend doing it I started using the speed options and its been a huge help for me, so just passing the trick on :-)
@mna226
@mna226 4 года назад
Thank you, this was very well explained. I was going through FPS character control in Godot documentation, but was not clear on many things. The way you added functionality step by step, explaining at every point what additional lines of code were doing, made it so much easier for me to understand.
@CodeWithTom
@CodeWithTom 4 года назад
You're welcome Muhammad, glad you enjoyed it and found it easy to understand :)
@youngsplasher7990
@youngsplasher7990 3 года назад
Why did everything he explained made sense to me first time. Usually, tutorial videos like this does not make sense to me and I have to re watch to understand. I respect your short on point explanations. No stretching out here.
@puppypie.
@puppypie. 4 года назад
This tutorial uses the most suitable standard API than I saw in other tutorials, which use a lot of non-standard unnecessary mathematical operations (I would say hacks, for example lerp function on both axis for smooth moving and so on), thanks! P.S. You can use clamp() function to set min and max viewing angle.
@CodeWithTom
@CodeWithTom 4 года назад
Thank you Denis I appreciate the feedback! (Good shout on the clamp function)
@vikkytg7230
@vikkytg7230 3 года назад
and wat is wrong with youtube ur channel is so underrated
@LordAlexander-x5s
@LordAlexander-x5s 3 года назад
I took one cs class in college and I was able to follow your tutorial! I appreciate you talking through your logic so I can more or less understand how the code works.
@torresmodernidad1262
@torresmodernidad1262 4 года назад
I was looking for a quick way to understand how the godot engine works by looking at someone code something simple and wow i just loved it! Thanks explaining everything so clearly and easy to understand. Keep it up!
@Connor3G
@Connor3G 4 года назад
Thanks for this tutorial. Currently my favorite Godot tutorial I've found so far.
@CodeWithTom
@CodeWithTom 4 года назад
That's so great to hear! Thank you
@flow_jbozz
@flow_jbozz 2 года назад
this has been the best tutorial ive come across so far. straight to the point, easy to follow and well explained. thank you
@skaruts
@skaruts 4 года назад
One thing you didn't address here (I don't know yet if you addressed it later), is that *velocity.y* is being reset every frame when you interpolated the vector, and so gravity isn't being accumulated and the player falls like it's on an elevator. I played around with two solutions: *1-* Store *velocity.y* in a throwaway variable right before interpolating the velocity, and then set *velocity.y* to it and apply gravity as normal. Basically this: *var y_speed = velocity.y* *velocity = velocity.linear_interpolate(direction * speed, acceleration * delta)* *velocity.y = y_speed* *velocity.y -= gravity* *2-* Interpolate only the *x* and *z* components of *velocity* with the *lerp()* function. Like this: *velocity.x = lerp(velocity.x, direction.x*speed, acceleration * delta)* *velocity.z = lerp(velocity.z, direction.z*speed, acceleration * delta)* *velocity.y -= gravity*
@CodeWithTom
@CodeWithTom 4 года назад
Very good point. For most cases this is ok, but if you're wanting a more realistic gravity effect then your solutions might be a good idea!
@jowilson5581
@jowilson5581 4 года назад
Thank you! This is easily the most concise, simple, well-coded and easy to follow video of this type I've found on RU-vid. Thank you, thank you, thank you.
@CodeWithTom
@CodeWithTom 4 года назад
Thank you for the amazing feedback, glad you enjoyed the content 😁
@mobinalimohammadi3519
@mobinalimohammadi3519 4 года назад
Absolutely brilliant Tom! It's one of the best and easiest tutorials I've seen! Thanks a lot, mate.
@CodeWithTom
@CodeWithTom 4 года назад
Thank you Mobin, glad you found it useful.
@Xx_Eric_was_Here_xX
@Xx_Eric_was_Here_xX 3 года назад
If you're having issues spawning the bullet: make sure the Player, Sprite, CollisionShape2D all have their centers aligned aligned! Player's elements can be at the bottom of the screen like in the video, but the Bullet should have everything aligned in the center (0,0)! I had to adjust the position offset a little bit, so my vector ended with position.y - 30 instead of 20, to avoid the Player getting nudged off screen with each bullet spawn. hope this helps someone. also, you can use print(......) to get an idea of what a line of script is doing, it will print it into the console. neat way to learn and find out what you're doing wrong
@garrettk7129
@garrettk7129 3 года назад
the only game dev tutorial channel whos code actually works for me, thank you!!!
@t3st3d
@t3st3d Год назад
this is the best godot tutorial i have seen.
@solomonsilbert-enright1270
@solomonsilbert-enright1270 3 года назад
thank you so much for this tutorial. I was having a really hard time figuring out godot and this helped a ton. super simple instruction, straight to the point and very easy to understand
@TheMaxthesis
@TheMaxthesis 4 года назад
Great video, love the pace and no nonsense to the point.
@CodeWithTom
@CodeWithTom 4 года назад
Thank you I really appreciate it
@Brewski66627
@Brewski66627 2 года назад
just started coding with godot and much thanks for this tutorial :) helping me understand it alot better, will continue and let u know how i get on hehe
@booooooooooooooooooooooooo
@booooooooooooooooooooooooo 2 года назад
Thank you soo much bro . I just started learning godot. This really helped me. Keep uploading. You re awesomme !!!!!💥💥💥
@OmegaF77
@OmegaF77 4 года назад
I think the better way to clamp the x rotation of the camera is by using the clamp function: var cam_x_rot = 0 func _input(event): if (event is InputEventMouseMotion): head.rotate_y(deg2rad(-event.relative.x * mouse_sens)) cam_x_rot += event.relative.y * mouse_sens cam_x_rot = clamp(cam_x_rot, -90, 90) camera.set_rotation_degrees(Vector3(-cam_x_rot, 0, 0))
@Raphipod
@Raphipod 4 года назад
worked right away! this also fixed the problem getting the head/camera stuck while looking down to the ground.
@madebyLGrabowski
@madebyLGrabowski 3 года назад
Great tutorial! Thanks so much, I've subscribed and am going to be taking a look through the rest of your channel.
@alistair_mcintyre
@alistair_mcintyre 4 года назад
This is an incredible tutorial. I am just getting into Godot and this is one of the best tutorials I have seen yet. Way too many people assume previous programming knowledge, you explain it very well. I have a game idea that I want to see through as a hobby project. Will certainly be catching up on the rest of your videos.
@CodeWithTom
@CodeWithTom 4 года назад
Thank you so much! I wish you lots of success on your project!
@bussin1337
@bussin1337 4 года назад
Great series overall but i have a suggestion on how to handle limiting the player to rotate far beyond 90 degrees, this is what you can do instead of having a global variable: # Rotate the whole player instead of just the head. self.rotate_y(deg2rad(-event.relative.x * mouse_sensitivity)); camera.rotate_x(deg2rad(-event.relative.y * mouse_sensitivity)); # We can make use of the rotation_degrees property and the method clamp var cam_rotation = camera.rotation_degrees; cam_rotation.x = clamp(cam_rotation.x, -90, 90); camera.rotation_degrees = cam_rotation;
@shire7949
@shire7949 4 года назад
Thanks!
@pierrenagonio
@pierrenagonio 4 года назад
Thank you. BTW do U know how to limit left and right sides? Not only up and down?
@bussin1337
@bussin1337 4 года назад
@@pierrenagonio Try this but it has an issue with it, it won't let you go far left at all even after you move there. I do have an idea on how to make it work though. Let me know if you would like to know. This is the code that isnt fully working: # Rotate the whole player instead of just the head. self.rotate_y(deg2rad(-event.relative.x * mouse_sensitivity)); camera.rotate_x(deg2rad(-event.relative.y * mouse_sensitivity)); # We can make use of the rotation_degrees property and the method clamp var cam_rotation = camera.rotation_degrees; cam_rotation.x = clamp(cam_rotation.x, -90, 90); camera.rotation_degrees = cam_rotation; # Limit player body y axis rotation var self_rotation = self.rotation_degrees; self_rotation.y = clamp(self_rotation.y, -90, 90); self.rotation_degrees = self_rotation;
@bussin1337
@bussin1337 4 года назад
​@@pierrenagonio I just uploaded this code here, it limits left and right side and it will rotate body to where camera is facing when you move forward. Note that I changed the Player scene's structure. Code and new scene structure here: gist.github.com/ShRyDeR/5db7e72775c4749ffea38ccf159552a2
@pierrenagonio
@pierrenagonio 4 года назад
@@bussin1337 amazing! Thank you very much for this work. I have took one part from your code and luckly is working with my game. Thank you one more time for your time and for sharing your knowledge. I wish I have you in my halp godo desk but I don't want to waste your time. Peace.
@s0ur31
@s0ur31 3 года назад
Very Helpful Tutorial......Thanks for making the FPS series
@nuralimedeu
@nuralimedeu 4 года назад
I wrote my script to be exactly like yours, but for some reason when I start the game my player always falls through the ground into the void. Can you explain this, please? Edit 1: It turned out my player fell through because I couldn't make the collision shape work without a static body attached to the ground. Thank you for this wonderful tutorial!
@ghostriley22
@ghostriley22 4 года назад
For quick prototype, you can use csg mesh where you have to just enable a checkbox for collision.
@nuralimedeu
@nuralimedeu 4 года назад
@@ghostriley22 How do you do this?
@ghostriley22
@ghostriley22 4 года назад
@@nuralimedeu when you add child node(Ctrl+A) search for CSG, there you will get csg cube, sphere , capsule similar to the ones in mesh instance. You will find Enable Collision tickbox in property panel
@nuralimedeu
@nuralimedeu 4 года назад
@@ghostriley22 Thank you.
@guyinplaid3472
@guyinplaid3472 2 года назад
My man this is an incredible tutorial. I was actually able to create what you did and everything! 10/10 Can't wait to check out your other tutorials
@Kura.tf2
@Kura.tf2 3 года назад
THIS VIDEO MADE ME SUBSCRIBE THANKS SO MUCH, and also this is Larry 🐺 he will protect you
@zzador
@zzador 4 года назад
Can not say less than "excellent tutorial". You may want to add as a side note that not normalizing the direction vector would result in the famous strafe running bug/feature which was present in the game "Doom" from 1993.
@CodeWithTom
@CodeWithTom 4 года назад
Thank you and very good point!
@mallimuondu6779
@mallimuondu6779 4 года назад
i am so happy most of the Godot projects I do they fail but this worked congrats :)
@put_istine
@put_istine 4 года назад
They should add this basic controller, physics as predefined...like in UE4...you can do all of this in only few clicks and even with much more tunning (acceleration, gravity, air control, movement mode: walking, crouching, flying, swimming etc) and with one click you can replicate all of this for multiplayer
@CodeWithTom
@CodeWithTom 4 года назад
I have no doubt that templates like that are in the pipelines :)
@emporioxorton
@emporioxorton 3 года назад
Amazing!, by far the best Godot FPS tutorial on RU-vid. Thank you so much! Keep up the great work.
@jaimerojas6578
@jaimerojas6578 4 года назад
Awesome Tom really liked this series of tutorials!
@user-oc9ho6kv1s
@user-oc9ho6kv1s 5 лет назад
Why use if statement for vertical camera rotation and not just clamp value like this: camera_x_rotation = clamp(camera_x_rotation + x_delta, -90, 90) ???
@CodeWithTom
@CodeWithTom 5 лет назад
You could certainly do that too. Good suggestion. 😁
@vickylance
@vickylance 4 года назад
Then how will you use that camera_x_rotation variable for camera.rotate_x function it requires the x_delta variable not the camera_x_rotation
@KaiDevvy
@KaiDevvy 3 года назад
@@vickylance could just update the actual x rotation. i.e var x_delta = -event.relative.y * mouse_sensitivity; camera.rotation_degrees.x = clamp(x_delta + camera.rotation_degrees.x, -90, 90);
@golammostofa31188
@golammostofa31188 4 года назад
Thank you very much for uploading this videos. this inspired and helped me to learning Godot
@CodeWithTom
@CodeWithTom 4 года назад
Hey Golam, you're most welcome!
@leroyjenkins614
@leroyjenkins614 4 года назад
this is really good! you ecplained what the code really does and that makes it easy for beginners! you also did an overview of the code at the end which further explains the code
@wolfsoldier0875
@wolfsoldier0875 4 года назад
You need more subs. Your great
@eod696
@eod696 4 года назад
This was an excellently presented example Tom, however I have one gripe. I added a crosshair to the UI control node, dead center of the screen, and found that small movements with my mouse were not registering as I expected them too. After hunting down a couple of other FPS tuts on Godot, I saw a key difference between those examples and yours - the camera movement occurs in the `_physics_process` listener rather than the `_input` listener. When I moved the camera movement into the physics process and accounted for the time-delta to make the movement FPS independent, I had to raise the mouse_sensitivity to 10, but after that, it worked precisely as I expected it to.
@CodeWithTom
@CodeWithTom 4 года назад
Good spot! Thanks for sharing 😁
@eod696
@eod696 4 года назад
@@CodeWithTom Welcome! Thanks for the intro to 3D. Like I say, it was excellently presented. Also, you gave insight into the library where others did not, and a person with development experience, like myself, will truly appreciate that. Cheers!
@anmolsurolia4864
@anmolsurolia4864 4 года назад
half code extends KinematicBody export var speed = 10 export var acceleration = 5 export var gravity = 0.98 export var jump_power = 30 export var mouse_sensitivity = 0.3 onready var head = $Head onready var camera = $Head/Camera var velocity = Vector3() func _input(event): if event is InputEventMouseButton Motion : head.rotate_y(deg2rad(event.relative.x * 0.3 )) func _physics_process(delta): var head_basis = head.get_global_transform().basis var direction = Vector3() if Input.is_action_pressed("move_forward"): direction -= head_basis.z elif Input.is_action_pressed("move_backward"): direction += head_basis.z if Input.is_action_pressed("move_left"): direction -= head_basis.x elif Input.is_action_pressed("move_right"): direction += head_basis.x direction = direction.normalized() velocity = velocity.linear_interpolate(direction * speed, acceleration * delta ) velocity = move_and_slide(velocity)
@carolbaskinss2373
@carolbaskinss2373 3 года назад
Great followable tutorial. I feel like I can now win game of the year
@skaruts
@skaruts 4 года назад
Getting the basis from the _camera_ instead of the _head_ seems to do half the job of turning your controller into a fly camera, which can be quite useful for debugging (and cheating).
@chaoskid1024
@chaoskid1024 2 года назад
27:50 F5 and F8 start and stop debugging respectively. So if you don't want to bind a key to unlock the cursor, you can just hit F8 to close the window.
@joliecat5463
@joliecat5463 4 года назад
Thank you, fantastic explained, everything traceable, thumbs up
@CodeWithTom
@CodeWithTom 4 года назад
Thanks Jolie, glad you found it useful!
@insidiousgamer6120
@insidiousgamer6120 4 года назад
Tom what should i do? When i type this script camera.rotate_x(deg2rad(-event.relative.y * mouse_sensitivity)) when i launch the game i does not work plsss help me!!!😫😫😫😫😫
@xerxesbuker2379
@xerxesbuker2379 3 года назад
Hey Tom, you should really do an update on this series since a lot of the code doesn't work as well as it used to.
@eddyrouhana4965
@eddyrouhana4965 3 года назад
i agree
@coltonosborne4474
@coltonosborne4474 3 года назад
Hello everyone. I was having an issue where my player was falling through the floor. Im not sure if this is due to an update or something. My kinematic body would not detect the collision with the floor, because godot didnt like having a collision shape attached to spaitial or mesh instance. I added a static body inbetween the spaitial and the mesh instance and that fixed the issue
@birdoflames329
@birdoflames329 2 года назад
i had the same problem and didnt manage to fix it, even with adding a static body between the spacial and the mesh instance
@krankyd2254
@krankyd2254 4 года назад
5:03 It’s not for anybody else it’s a reminder of where I last was
@HighOnQuack.
@HighOnQuack. 4 года назад
LOL i still clicked it
@willaturner114
@willaturner114 4 года назад
wourld
@willaturner114
@willaturner114 4 года назад
@@HighOnQuack. me too
@nimmen
@nimmen 3 года назад
If you treat the ingame units as meters, and size the character and all your game objects accordingly, the variables like speed and acceleration will be in m/s and m/s^2 Currently I have the first person collider at 1.80m tall and 0.50m wide (radius 0.25) and the camera height at 1.65m, which would be eye height. Rotating the camera up and down goes around a RotationHelper (your Head) node, like in the official tutorial, which I have placed 0.15m lower than the camera, at 1.50 m. I think this makes the up and down movement more realistic looking, as you would pivot your head at your neck, not your eyeballs.
@BluzBazz
@BluzBazz 3 года назад
Outstanding tutorial! Liked and subscribed.
@arkumar842
@arkumar842 3 года назад
This is soooo great!
@butanddingj4393
@butanddingj4393 3 года назад
this was so easy to follow, thank you so much!
@BrianRogers3D
@BrianRogers3D 4 года назад
Well done Tom! Very clear and to the point. Quick question: Why did you put the movement on the Head node instead of the Player node? Wouldn't that just move the head without the body? regardless, thanks so much for this video and the other FPS tutorials you've made.
@dArtistGames
@dArtistGames 4 года назад
He didn't. He used the head's basis value to find direction. movement is applied from the velocity variable and on the Player node.
@daorigingamer5359
@daorigingamer5359 4 года назад
Hey Tom, amazing tutorial so far, but i cant seem to run the project. I get an error every time saying Failed to build project solution
@CodeWithTom
@CodeWithTom 4 года назад
Hey thanks for the feedback! That's strange, do you get any more error messages? If you are able to join the discord and share your project files with me I would be happy to take a look
@italiatroller4793
@italiatroller4793 3 месяца назад
tried to replicate this using visual script and worked :)
@Red_Eagle
@Red_Eagle 3 года назад
+1 sub
@fernandogramirez1
@fernandogramirez1 2 года назад
thanks for this amazing tutorial! Done!
@ZakRahman
@ZakRahman 3 года назад
Absolutely fantastic video. Great explanations. Thank you!
@halleyqueen4807
@halleyqueen4807 2 года назад
I really appreciate your help!
@MAJ4K
@MAJ4K 3 года назад
I liked this video just because of 7:19
@san4uks.l835
@san4uks.l835 3 года назад
Hey Tom, my movement doesn't working, i checked all text, 1v1 to yours, but doesn't move.
@amirghalbarband3038
@amirghalbarband3038 2 года назад
That was great man, thanks a lot bro
@3rdpoly
@3rdpoly 4 года назад
The man says the name correct - you have earned your like from me - keep it up 💪🏻
@CodeWithTom
@CodeWithTom 4 года назад
Haha, thanks!
@rambosweat
@rambosweat 3 года назад
you can also use the $Head object's rotation_degrees.x instead of rotate_x() which forces you to mess with deg2rad(), instead of just using degrees directly. not sure if this is a 3.2.3 specific feature though...
@JacobBecauseWhyNot
@JacobBecauseWhyNot 4 года назад
Help I can’t move in any direction other than left
@CodeWithTom
@CodeWithTom 4 года назад
Hi, have a check of your `if` statements and make sure you're also checking the `move_right` and other input actions.
@conspiracyman5031
@conspiracyman5031 3 года назад
Thanks a lot, I enjoy your tutorials
@NotIn_Use12
@NotIn_Use12 2 года назад
I keep getting a error get_node: (Node not found:"head" relative to "/root/World/Player").)
@321357w
@321357w 5 лет назад
very well presented and explained, looking forward to more.
@CodeWithTom
@CodeWithTom 5 лет назад
Cheers Jeff really appreciate that. Hope you find the 2nd and 3rd parts useful too
@321357w
@321357w 5 лет назад
@@CodeWithTom Hi Tom, I just noticed as I am using Godot 3.1 that I have this error code ( The argument 'delta' is never used in the function '_process'. ), is this something with 3.1 as the player will no longer move and I am unsure where things are amiss. Thanks for your reply.
@duckgaming94
@duckgaming94 2 года назад
@@CodeWithTom for some reason i can only move right can you plz help me
@comnrade
@comnrade 2 года назад
Invalid get index 'relative' (in base: 'InputEventKey'). Can someone help me? when I start the game from the menu it works normally, but the console detects this bug, and when I have run by F5, it just closes by itself after I press any movement key
@Warionator
@Warionator 4 года назад
Hey, I am using 3.2.1, and there are different trimesh collision options, I was wondering what the difference between them was. Godot explains briefly, but I am not too sure about what they mean by "slowest" or "accurate" There's trimesh static body, trimesh collision sibling, and multiple convex collision siblings.
@brokethumb1381
@brokethumb1381 4 года назад
you should be able to click single convex collison shapes
@voidzmhm
@voidzmhm 4 года назад
just click on single convex collison shapes
@kurtisknodel
@kurtisknodel 4 года назад
I realize this is a bit late, but I'll try to help anyways. "slowest" and "accuracy" are in terms of physics simulation. Due to computers having finite processing power and memory, we can't simulate physics at 100% accuracy. Thus, there is a tradeoff: You can have really fast physics simulation with less accuracy, or you can have slower physics simulation with more accuracy. If a collider says it's slower or more accurate, that's all it means: It will make the physics simulation take longer, but it will be closer to real life.
@BW-ye6mx
@BW-ye6mx 7 месяцев назад
It's working. Now make a video of how to make one on the cell phone. Android.
@foam444
@foam444 4 года назад
I got a problem with the code it had to do with line 16: var direction = Vector3() Does anybody know how to fix it? It says it's an indentation problem, but whoever I tab it again or untab it adds that problem to the next line.
@CodeWithTom
@CodeWithTom 4 года назад
Make sure all of the code you want to sit inside a particular code block is indented at the same level
@greatvaluehokage139
@greatvaluehokage139 3 года назад
Your awesome man keep up the good work 👍
@jester.ytt0
@jester.ytt0 3 года назад
My file corrupted right before I finished my game :( I'm back here and I'm saving 6:44 for when I'm done with my homework
@JamesPlaysJP
@JamesPlaysJP 4 года назад
I’m having a problem, my character is only going right, only the D key works
@titman4645
@titman4645 4 года назад
Me too
@Boofener
@Boofener 3 года назад
make sure you have the key mappings spelled correctly
@SpikertheHero
@SpikertheHero 3 года назад
movement doesn't work for me does anyone have a solution?
@Texial
@Texial 4 года назад
Best tutorial IN DA WORLD now i can impress my brother that uses unity and godot and he makes computers and fixes them! lol so thanks!
@CodeWithTom
@CodeWithTom 4 года назад
Glad you liked it!
@GZGemingBoi
@GZGemingBoi 4 года назад
okay i cant move forward. so i can use S A D but nor W
@QqQq-bf8bd
@QqQq-bf8bd Год назад
i make 3d fps game for mobile, but i will try to play in mobile , i will touch(swipe) mouse motion only, it will work properly, and i will touch (move) joystick only, then joystick work properly, but i will use both of them, first i will touch mouse motion and after touch joystick, both of them work properly but first i will touch joystick and after touch mouse motion , joystick will work but mouse motion not work, 😢😢how to solve please help
@TheRealKaiProton
@TheRealKaiProton 3 года назад
That was great, Watched this pt1 yesterday to get a feel for it, and just gone over it again following along in godot, nice clean code, allowed me to add a double jump, and disable to controls in the game with the mouse capture parts, something that I dont understand, is on the Clamping of the head angle, why not user the clamp function in the engine?
@YermakTheMapper
@YermakTheMapper 5 лет назад
Very nice and informative tutorial! Thank you!
@CodeWithTom
@CodeWithTom 5 лет назад
Cheers Yermak glad you liked it!
@shire7949
@shire7949 4 года назад
This is great! Thank you.
@johnnythin7586
@johnnythin7586 3 года назад
I have a problem. I fall through the floor when I have gravity on so I think it’s something to do with how the player collides with the collision shape
@aloHanter9072
@aloHanter9072 4 года назад
Where can I download this wallpaper?
@samuelbraker4116
@samuelbraker4116 3 года назад
something weid happend and every time i press forward i go down and i keep falling through the floor
@cruzin8056
@cruzin8056 3 года назад
Same with mine, i keep tryna figure out what i did wrong, but i cant find anything, maybe just retry it again :(
@annon-ski7985
@annon-ski7985 4 года назад
Man your coding is clean.
@CodeWithTom
@CodeWithTom 4 года назад
Hah thanks. I'm not focussing on clean code in these tutorials, I could spend hours talking about refactoring but that's not really the primary goal here. But glad you found it to be clean!
@logywonds6069
@logywonds6069 3 года назад
I have a old graphic and it won't let me do anything :c
@waywardpooch9567
@waywardpooch9567 5 лет назад
Thank you very much for posting! Subscribed.
@CodeWithTom
@CodeWithTom 5 лет назад
Thank you, I'm glad you liked this video.
@Benchmus
@Benchmus 3 года назад
odd i cant move right and my forward is slow one press to move but this tutorial help
@foxvlogsandm0re408
@foxvlogsandm0re408 4 года назад
I loved the tutorial but I'm using the Godot 3.2.2 and I'm not sure what happend but it told me that an error occurd and my elif statement for the forward and backard if statement was misplaced here are my code lines for reference. if Input.is_action_pressed("move_forward"): direction -= head_basis.z elif Input.is_action_pressed("move_backward"): direction += head_basis.z
@ejoojoo
@ejoojoo 3 года назад
Why not use the clamp function to restrict up down camera rotation
@youngsplasher7990
@youngsplasher7990 3 года назад
Why did you use Camera node for Y mouse movement and Head node for X mouse movement? Shouldn't they use same node?
@jlewwis1995
@jlewwis1995 5 лет назад
Why do you rotate the head when panning the camera left and right but only the camera when panning up and down? The camera is a child of the head so it should always rotate along with it right?
@CodeWithTom
@CodeWithTom 5 лет назад
Good question. There are numerous reasons. One being to do with the way 3d rotations work with Euler angles. It would become distorted. The second is due to using the camera z basis for the forward vector for movement. If you rotate the whole head, the forward vector won't be parallel to the ground so you end up with slower movement when looking down.
@CodeWithTom
@CodeWithTom 5 лет назад
Take a look at the gifs as you scroll down this page to see the distortion I mention. Of course you can do it differently ,ensuring you rotate on the Y first. But separating the head object rotation has other benefits such as the z basis issue. docs.godotengine.org/en/3.1/tutorials/3d/using_transforms.html
@eldelnacho
@eldelnacho 4 года назад
Thank you very much! Very helpful videos!
@CodeWithTom
@CodeWithTom 4 года назад
You're very welcome!
@bertptrs
@bertptrs 4 года назад
hi Tom. just to let you know, the CollisionShape you set up around 5:50 doesn't really work. the moment you turn on gravity you fall trough your ground. You fixed it yourself here, as you show us also another way to set it up (with a static body). Because you stick to that for the remainder of the course you don't notice, but if you stick with a CollisionShape on a MeshInstance as shown around 5:50 your project goes wrong the moment you turn on gravity.
@CodeWithTom
@CodeWithTom 4 года назад
You're right, thanks for pointing that out. Going with the static body approach is the way to go 😁
Далее
Raycast Weapons in Godot - Make an FPS in Godot Part 2
29:00
The Art of Game Optimization
10:18
Просмотров 263 тыс.
Wife habit 😂 #shorts
00:16
Просмотров 24 млн
WILL IT BURST?
00:31
Просмотров 3,2 млн
Can AI Code a Horror Game? Watch ChatGPT Try
8:06
Просмотров 1,1 млн
I Built a Transparent Boomerang (it's lethal)
13:10
The Clever Way to Count Tanks - Numberphile
16:45
Просмотров 1 млн
Let's Try: Godot Engine - Is it good?
9:38
Просмотров 305 тыс.
Where Do Hyrule's Rivers Go?
30:45
Просмотров 1,7 млн
I Made the Same Game in 8 Engines
12:34
Просмотров 4 млн
I Tried To Beat Minecraft Backwards
18:53
Просмотров 1,4 млн
I Made My First Game in Godot in 3 Weeks...
26:21
Просмотров 316 тыс.
Wife habit 😂 #shorts
00:16
Просмотров 24 млн