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: th-cam.com/play/PLbuK0gG93AsHID1DDD1nt4YHcdOmJvWW1.html
omg u have no idea how incredibly helpful this was!! i’ve been struggling to find good tutorials like this where there’s actually explanations instead of someone just adding random code without explaining it at all. especially since there’s not that many people that make 3d tutorials of godot in the first place. but anyways, this was amazing and i can’t wait to watch more of your videos :D keep up the good work !!
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.
@@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?
@@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
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.
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.
You probably have the best tutorial style for fps games right now. I love how you get to the point while also explaining everything really well. Also well done for using proper variable standards and using built in functions, another tutorial i was watching was jumping all over the place haha
I did something a little extra. I made it so sprinting isn't used unless there is forward velocity. If you're moving backwards or directly sideways, sprint doesn't work. Only forward. 👍
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 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.
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
39:45 I know you have updated tutorials but it seems like this is still your solution. Since I don't need full on surfing in my project, I'm gonna omit this. Definitely find a new solution if you can though, I can easily imagine a bug that gets you stuck in floating mode. Look up the Red Letter Day skip in Half-Life 2 if you want to understand why this can be a SMALL issue. Fast Edit: It's not explicitly Red Letter Day I guess. Watch a Half-Life 2 speed run, it's very early on. You're looking for them to jump off a roof onto a street that should definitely kill the player, and then they'll rub up against a car for a little bit. Then something MAGICAL happens.
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.
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.
hello ! great tutorial, but i feel like a simple jump after walking make you jump really far away, how would you tweak the specific amount you can jump when pressing forward while jumping ? i feel like it shouldn't be the same initial velocity as walking, maybe normalized since you are going up and front. so where would that be added ?
I'm a little confused as to how the air_cap, air_accel and air_move_speed variables are affecting the air strafing. Right now it feels like I can accelerate way too fast and turn way too far without a speed penalty.
If I wanted to make strafing and back-stepping at two different speeds than the forward movement, what would be your method to change the code? I did it my own way, but I don't believe it's anywhere near the ideal method (I changed the accel, decel, and speed values based on the inputs in the get_move_speed function. I also have a walk variable, making the code lengthy with 12 elif statements.) On the bright side, the way I did it allows for a highly refined movement system (I thought changing the friction would be redundant, but I'm thinking about changing the jump height.)
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.
Great tutorial, The only problem I have is when ever I land after surfing or run into a wall while bhoping my character gets stuck in MOTION_MODE_FALLING.
I'm running into some issues with the "Advanced ground movement with friction/bhop" section. I copied exactly what was in the video but unless I decrease the ground_friction var from 6.0 to atleast 5.0 or lower my character doesn't move when I press forward. I even downloaded the starter project file from github and copy pasted the _handle_ground_movement func from their (except for the headbob piece, I didn't want to add headbob) and I'm still frozen when the friction value is set at 6.0. This wouldnt be a problem if setting the friction value lower also made my base speed extremely fast. Any ideas on fixing this issue?
It's hard to say without seeing your code, those accel/decel/friction vars are pretty sensitive though. I would try with my values first, copying exactly from my code. Then adjust one by one. Yes if friction or decel is higher than accel or walk speed, probably you won't be able to move. I don't have a clear explanation for each, other than it's just the quake/source movement recipe. Not super intuitive but it gets the exact same movement style so it's important that these variables are used how they are. So I would try copying exactly from my code and changing one by one adjusted until you get your desired move speed/feel. Also check if the properties are changed in the editor inspector on your character, if you change them once, they will stay the same even if you change them in code I think. If you can't figure it out, you can pastebin your code and message it to me on twitter and I could take a look if you want.
I think it's kind of hard to remove completely and keep source style movement. You can try things like increasing friction, and decreasing the air_accel and other air movement variables to help prevent movement exploits like bhop. For a more simple version, I'd recommend LegionGames FPS tutorial and take the air movement code from there which is much simpler and should help prevent bhop.
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?
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
@@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.
@@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.
@@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
I've been having an issue where godot does not recognise the the function get_move_speed() , despite it being used in the advanced movement + friction section of the video, do you know why this could be happening and do you have any advice that could help? Thanks
Also thanks a lot for this tutorial! its very informative and its helped me understand how movement and physics work in this engine, despite the one hiccup ive had (which is probs my fault lol) everything ive interpreted from the video has worked flawlessly
I want to limit the players bhop speed but keep the speed in air uncapped so surfing etc isn't effected. The player should still be able to exceed the max speed cap in air through strafing but be set back to the threshold after touching the ground. Tried to implement it myself but it felt unsmooth as the change in speed was really noticeable. Dont want the player to go to fast.
So this video is already deprecated due to the experimental nature of Godot, rotate_x is no longer a supported method. It is now rotate(), E.G. $Camera3D.rotate(Vector3(1, 0, 0), -event.relative.y * look_sensitivity) would have been nice, if they slowly phased out old methods, instead of dropping them next update lmao
Since people were understandably asking about ladders I thought I'd post something up that I hacked together. if isTouchingLadder == false: self.velocity.x = wishDirection.x * getMoveSpeed() self.velocity.z = wishDirection.z * getMoveSpeed() elif isTouchingLadder == true: self.velocity.x = 0 self.velocity.z = 0
if isTouchingLadder == true && Input.is_action_pressed("Forward"): self.velocity.y = 1 if isTouchingLadder == true && Input.is_action_pressed("Backward"): self.velocity.y = -1 if isTouchingLadder == true && Input.is_action_just_released("Forward") || Input.is_action_just_released("Backward"): self.velocity.y = 0 elif isTouchingLadder == true && Input.is_action_just_pressed("Jump"): isTouchingLadder == false Seems to work alright, I prefer having more control on ladders when it comes to my movement so on this one you can go up and down I think there's a bit of a bug where the jump key doesn't seem to quite work right away but that's potentially just my character clipping through the ladder and not colliding correctly because when I crouch and jump instead it comes off the ladder which I kind of like anyway lol. The IsTouchingLadder is simply a boolean, I had it change based on whether or not I triggered an Area3D in this case on the ladder and then that allowed the ladder movement to happen, if you want to do it with a keypress just edit the code to your liking, everyone's got their preferences.
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: th-cam.com/play/PLbuK0gG93AsHID1DDD1nt4YHcdOmJvWW1.html
This is easily the best first person character controller tutorial for godot on TH-cam, seriously! You have no idea how helpful this was, cheers.
omg u have no idea how incredibly helpful this was!! i’ve been struggling to find good tutorials like this where there’s actually explanations instead of someone just adding random code without explaining it at all. especially since there’s not that many people that make 3d tutorials of godot in the first place. but anyways, this was amazing and i can’t wait to watch more of your videos :D keep up the good work !!
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
Are you serios, I've spent so long trying to code source style movment and failing. You're a god's send!
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.
@@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?
@@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
@@fluttershy3642 Bro you just reminded me so hard of CS 1.6 surf maps
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.
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.
You are a LEGEND! Thank you so much for your clear and in-depth explanations of these topics.
Awsome. i love me some Source movement. Thank you Maj
Was looking to learn 3d in Godot, will be following this tutorial!
Excellent stuff, you're a great teacher.
You probably have the best tutorial style for fps games right now. I love how you get to the point while also explaining everything really well. Also well done for using proper variable standards and using built in functions, another tutorial i was watching was jumping all over the place haha
This video is a hidden gem
I did something a little extra. I made it so sprinting isn't used unless there is forward velocity. If you're moving backwards or directly sideways, sprint doesn't work. Only forward. 👍
thanks loved learning this!
Wonderful content. Thank you for your time and effort.
Ooooh nice bro ! helping a lot !
might be too advanced for me but thanks a lot for the share of knowledge.
THIS IS INSANE
Amazing vid rly helpful, do you think there would be a way to combine surfing and titanfall style wallrunning code ?
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.
@@MajikayoGames yeah exactly provided you have enough momentum to wallrun but also are there any similarities between wallrunning and surfing logic
@@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.
@@MajikayoGamesthx for explaining how i could go about it I'll try it out, looking forward to ur vids tho
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
excellent video and explaining, will you in the future make a video showing how to create a gun with animations?
39:45 I know you have updated tutorials but it seems like this is still your solution. Since I don't need full on surfing in my project, I'm gonna omit this. Definitely find a new solution if you can though, I can easily imagine a bug that gets you stuck in floating mode.
Look up the Red Letter Day skip in Half-Life 2 if you want to understand why this can be a SMALL issue.
Fast Edit: It's not explicitly Red Letter Day I guess. Watch a Half-Life 2 speed run, it's very early on. You're looking for them to jump off a roof onto a street that should definitely kill the player, and then they'll rub up against a car for a little bit. Then something MAGICAL happens.
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.
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.
since this is an FPS tutorial series, will there ever be a weapon system, or will it just be movement related?
hello ! great tutorial, but i feel like a simple jump after walking make you jump really far away, how would you tweak the specific amount you can jump when pressing forward while jumping ? i feel like it shouldn't be the same initial velocity as walking, maybe normalized since you are going up and front. so where would that be added ?
I'm a little confused as to how the air_cap, air_accel and air_move_speed variables are affecting the air strafing. Right now it feels like I can accelerate way too fast and turn way too far without a speed penalty.
If I wanted to make strafing and back-stepping at two different speeds than the forward movement, what would be your method to change the code? I did it my own way, but I don't believe it's anywhere near the ideal method (I changed the accel, decel, and speed values based on the inputs in the get_move_speed function. I also have a walk variable, making the code lengthy with 12 elif statements.) On the bright side, the way I did it allows for a highly refined movement system (I thought changing the friction would be redundant, but I'm thinking about changing the jump height.)
how do i turn while jumping with just mouse movement? i dont want to hold strafe keys while doing this
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.
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.
Great tutorial, The only problem I have is when ever I land after surfing or run into a wall while bhoping my character gets stuck in MOTION_MODE_FALLING.
nvm just a very small typo
I'm running into some issues with the "Advanced ground movement with friction/bhop" section. I copied exactly what was in the video but unless I decrease the ground_friction var from 6.0 to atleast 5.0 or lower my character doesn't move when I press forward. I even downloaded the starter project file from github and copy pasted the _handle_ground_movement func from their (except for the headbob piece, I didn't want to add headbob) and I'm still frozen when the friction value is set at 6.0. This wouldnt be a problem if setting the friction value lower also made my base speed extremely fast. Any ideas on fixing this issue?
It's hard to say without seeing your code, those accel/decel/friction vars are pretty sensitive though. I would try with my values first, copying exactly from my code. Then adjust one by one. Yes if friction or decel is higher than accel or walk speed, probably you won't be able to move. I don't have a clear explanation for each, other than it's just the quake/source movement recipe. Not super intuitive but it gets the exact same movement style so it's important that these variables are used how they are. So I would try copying exactly from my code and changing one by one adjusted until you get your desired move speed/feel. Also check if the properties are changed in the editor inspector on your character, if you change them once, they will stay the same even if you change them in code I think. If you can't figure it out, you can pastebin your code and message it to me on twitter and I could take a look if you want.
Hello, very good tutorial but I have a doubt, when I stick to a straight wall the speed increases, how can I prevent that?
👍🏽👍🏽👍🏽
How would I go about removing b-hopping if I didn't want my game to have it?
I think it's kind of hard to remove completely and keep source style movement. You can try things like increasing friction, and decreasing the air_accel and other air movement variables to help prevent movement exploits like bhop. For a more simple version, I'd recommend LegionGames FPS tutorial and take the air movement code from there which is much simpler and should help prevent bhop.
Is there any reason to use the self keyword, or is it just for readability.
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
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?
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
@@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.
@@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.
@@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
Is there any way for me to directly copy and paste all the code because it’s taking me way to long to write it down
the github link in the description has the completed project
@@MajikayoGames thx and your amazing at what u do btw
I've been having an issue where godot does not recognise the the function get_move_speed() , despite it being used in the advanced movement + friction section of the video, do you know why this could be happening and do you have any advice that could help? Thanks
Also thanks a lot for this tutorial! its very informative and its helped me understand how movement and physics work in this engine, despite the one hiccup ive had (which is probs my fault lol) everything ive interpreted from the video has worked flawlessly
I’m guessing it would work the same for 3rd person?
What about those stairs though? 😁
Tutorial for those should be out in a few days as part of this series :) have 1 short vid to make before that
Are you god?
I want to limit the players bhop speed but keep the speed in air uncapped so surfing etc isn't effected. The player should still be able to exceed the max speed cap in air through strafing but be set back to the threshold after touching the ground.
Tried to implement it myself but it felt unsmooth as the change in speed was really noticeable.
Dont want the player to go to fast.
So this video is already deprecated due to the experimental nature of Godot, rotate_x is no longer a supported method.
It is now rotate(), E.G. $Camera3D.rotate(Vector3(1, 0, 0), -event.relative.y * look_sensitivity)
would have been nice, if they slowly phased out old methods, instead of dropping them next update lmao
From what I can tell both are available still? At least in 4.3: docs.godotengine.org/en/stable/classes/class_node3d.html#class-node3d-method-rotate-x
@@MajikayoGames it throws an error as a null reference
@@MajikayoGames you know what, I think it's a mistake on my part, because it's not referencing the camera object for some reason.
embarrassing.
Yeah, it was an error on my part, I deeply apologize for any misinformation I may have spread.
@@christophereberhart7487 no worries everyone makes mistakes.
Since people were understandably asking about ladders I thought I'd post something up that I hacked together.
if isTouchingLadder == false:
self.velocity.x = wishDirection.x * getMoveSpeed()
self.velocity.z = wishDirection.z * getMoveSpeed()
elif isTouchingLadder == true:
self.velocity.x = 0
self.velocity.z = 0
var inputDirection = Input.get_vector("Right", "Left", "Backward", "Forward").normalized()
wishDirection = self.global_transform.basis * Vector3(-inputDirection.x, 0, -inputDirection.y)
if isTouchingLadder == true && Input.is_action_pressed("Forward"):
self.velocity.y = 1
if isTouchingLadder == true && Input.is_action_pressed("Backward"):
self.velocity.y = -1
if isTouchingLadder == true && Input.is_action_just_released("Forward") || Input.is_action_just_released("Backward"):
self.velocity.y = 0
elif isTouchingLadder == true && Input.is_action_just_pressed("Jump"):
isTouchingLadder == false
Seems to work alright, I prefer having more control on ladders when it comes to my movement so on this one you can go up and down I think there's a bit of a bug where the jump key doesn't seem to quite work right away but that's potentially just my character clipping through the ladder and not colliding correctly because when I crouch and jump instead it comes off the ladder which I kind of like anyway lol.
The IsTouchingLadder is simply a boolean, I had it change based on whether or not I triggered an Area3D in this case on the ladder and then that allowed the ladder movement to happen, if you want to do it with a keypress just edit the code to your liking, everyone's got their preferences.
Looks great! I have a more comprehensive video on ladders as well if anyone is interested: th-cam.com/video/uW01u_1PldI/w-d-xo.html
wish_dir = self.global_tranform.basis * Vector3(-input_dir.x, 0., -input_dir.y)