How to Create SMOOTH Player Movement in Godot 4.0

  Рет қаралды 100,309

DevWorm

DevWorm

Күн бұрын

Пікірлер: 270
@redawgts
@redawgts Жыл бұрын
The code can be simplified with `Input.get_vector` and `velocity.move_toward`. You get the same effect with less lines of code.
@JAMRIOT
@JAMRIOT Жыл бұрын
hey im totally new to this, what lines would i replace with these two?
@sheepcommander_
@sheepcommander_ Жыл бұрын
Thanks a lot!
@sheepcommander_
@sheepcommander_ Жыл бұрын
@@JAMRIOT velocity = Input.get_vector("left","right","up","down") * SPEED move_and_slide()
@lunarfoxgames
@lunarfoxgames Жыл бұрын
This is so cool, thanks!
@MootPotato
@MootPotato 11 ай бұрын
@@sheepcommander_ I do apologize but I am still having trouble figuring out what to do to simplify this code. If someone could provide a little more detail I'd be so grateful! I am not finding the lines mentioned and no matter what I try to change it just bugs out.
@marcosmachado6844
@marcosmachado6844 10 ай бұрын
For people around still Simplified code with just 7 lines of code: func player_movement(input, delta): if input: velocity = velocity.move_toward(input * SPEED , delta * ACCELERATION) else: velocity = velocity.move_toward(Vector2(0,0), delta * FRICTION) func _physics_process(delta): var input = Input.get_vector("ui_left","ui_right","ui_up","ui_down") player_movement(input, delta) move_and_slide()
@jiboodie5344
@jiboodie5344 10 ай бұрын
it says speed not declared
@marcosmachado6844
@marcosmachado6844 10 ай бұрын
@@jiboodie5344 add the following lines after extends CharacterBody2D: @export var SPEED = 100 @export var ACCELERATION = 200 the @export keyword allows you to change these values on the editor itself
@mukakatae3743
@mukakatae3743 10 ай бұрын
Add a speed variable to your character ​@@jiboodie5344
@ISAIAH_E_E
@ISAIAH_E_E 9 ай бұрын
Correct me if I'm wrong but if you're running your movement functions inside _physics_process shouldn't you go ahead and get rid of delta in move_towards?
@marcosmachado6844
@marcosmachado6844 9 ай бұрын
Its because you are running it inside the physics process that you do want to have the delta there. Physics process is called every frame and delta is the time passed between the last frame and the current frame. If your computer is running at let's say 60 FPS, your delta value would be usually something like 0.01667, but if it was running at 120 it would be something like 0.083334. If you dont actually put delta there, the player would be moving at the top speed, every frame, and instead of having that smooth movement the player would move extremely faster than it should. Putting delta there guarantees that the player will have that smooth movement and that it will work as intended, no matter the FPS your machine is running at.
@coenraadgreyling4000
@coenraadgreyling4000 6 ай бұрын
For anyone who wants to use animations with their sprite and is struggling, I added a few lines of code based off of dev worm's other video to help: Declare at top: var current_direction = Vector2.ZERO var current_animation = "" Add to existing code: func _physics_process(delta): player_movement(delta) play_direction_anim(delta) func play_direction_anim(delta): var anim = $AnimatedSprite2D var new_animation = "" if input.x != 0 or input.y != 0: current_direction = input if current_direction.x > 0 and velocity.length() > 0: new_animation = "walk_right" elif current_direction.x < 0 and velocity.length() > 0: new_animation = "walk_left" elif current_direction.y > 0 and velocity.length() > 0: new_animation = "walk_down" elif current_direction.y < 0 and velocity.length() > 0: new_animation = "walk_up" else: if current_animation.ends_with("_right") and velocity.length() == 0: new_animation = "idle_right" elif current_animation.ends_with("_left") and velocity.length() == 0: new_animation = "idle_left" elif current_animation.ends_with("_down") and velocity.length() == 0: new_animation = "idle_down" elif current_animation.ends_with("_up") and velocity.length() == 0: new_animation = "idle_up" if new_animation != current_animation: anim.play(new_animation) current_animation = new_animation
@зовименяпапикс
@зовименяпапикс 2 ай бұрын
this freed my soul
@TheDawnprojekt
@TheDawnprojekt Ай бұрын
you can also set animatedSprite2D to be a unique name so you call it with % ?
@udtsans1138
@udtsans1138 Ай бұрын
Do I have to add this to the bottom or top of the existing code?
@dajoma36
@dajoma36 Жыл бұрын
Thank you for another great video. You have a knack for explaining things that is easy to follow and understand. I am looking forward to more of your videos on Godot 4.0. I really like that you explain what is different in Godot 4 from Godot 3 and I can't wait to see what you cover next. You be safe, and have a great day.
@dev-worm
@dev-worm Жыл бұрын
Glad it was helpful! Looking to make many more godot 4 tutorials, and if you need anything let me know!
@iPlay1337
@iPlay1337 10 күн бұрын
bro idk what you do for a living but like you need to do this. the way you explain this is so well that even i could understand it (only been coding for liek 2 weeks). so thank you
@covereye5731
@covereye5731 9 ай бұрын
Really useful for creating slippery ice floor movement. I was setting new velocities instead of adding and substracting to it, which gave me a lot of issues on the slip behaviour when turning directions
@davekudrev4849
@davekudrev4849 Жыл бұрын
Thank you so much! I been looking ages for a guide to set up a character body movement identical to rigid body. This is going to be a great foundation to play around with. You made my Monday evening a blissful one. :)
@marketwoodfarm
@marketwoodfarm 3 ай бұрын
Thanks for this, the below, does the same, just shorter. extends CharacterBody2D const max_speed = 400 const accel = 1500 func _physics_process(delta): # Update velocity towards the desired direction based on input velocity = velocity.move_toward(Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") * max_speed, accel * delta) # Move the character move_and_slide()
@dev-worm
@dev-worm 3 ай бұрын
nicely done!
@yt159-sj6hd
@yt159-sj6hd 11 күн бұрын
hippity hoppity all your code is now my proprety! seriously thanks guys ive been new to godot for a month now.
@Ratankumar-rs9pt
@Ratankumar-rs9pt 7 күн бұрын
Thanks I copy and I was my paste on my Godot 4.0
@williambrodzinski
@williambrodzinski Жыл бұрын
Thank you so much I cant tell you as someone who has just got into coding how much this has helped with my players movement your way of explaining things is amazing and I left and sub and like and about to go watch more of your vids! Keep up the good work!!
@dev-worm
@dev-worm Жыл бұрын
thanks bro, looking to upload many more tutorials on all godot topics
@completelyrandomlyhandlee
@completelyrandomlyhandlee 4 ай бұрын
EVERYTIME i start a game (super noob, still a hobby), i try to reinvent the wheel with controls. THIS is how to do it.. the other ways can feel different/fun, BUT the bugs it presents are endless down the line. Stick with this, make it feel how you want by modifying it, but if you are day one new..... just do this, it IS correct. Thats why for the 5th time ive tried to vary movement, i have found my way back to tutorials to debug. if i can offer any advice to other new people, just do this!
@schuepbachr
@schuepbachr Ай бұрын
Happy to have found you- getting started on my first project ever, and tutorials like this are so freakin' helpful.
@Tmaster2006YT
@Tmaster2006YT 4 ай бұрын
Thank you. This is the first coding tutorial I’ve followed that gave me a tangible result.
@dev-worm
@dev-worm 4 ай бұрын
so glad it was able out!
@blackjacked_xiii
@blackjacked_xiii 6 ай бұрын
I appreciate you taking the time to explain what your code means.
@dev-worm
@dev-worm 6 ай бұрын
happy to hear!! hope it helped! thank you!
@arukon3111
@arukon3111 11 ай бұрын
Stumbled upon this when looking for something else, but damn, it helped me a lot. i was worried about scaleability with my previous approach on player movement but your code eliminated that fear and got me excited to build on it. Thanks a bunch for the great video!
@dev-worm
@dev-worm 11 ай бұрын
so happy to hear that!
@BiffleDiffle-1
@BiffleDiffle-1 6 күн бұрын
this is peak of usefulness for people like me who are more interested in the level and visual design than the coding of it all! if yo dont mind, im gonna use this code with a couple modifications to the starting constants this earned a like for how digestable it is too
@BiffleDiffle-1
@BiffleDiffle-1 6 күн бұрын
now that i think about it, its sub worthy, i look forward to future totorials on game code like this
@dev-worm
@dev-worm 5 күн бұрын
aw thank you so much!! that means the world, and of course feel free to use it whenever! If you ever have any questions I am here for you!
@Miiite
@Miiite Жыл бұрын
Your video si already very clear, but what might make it clearer is adding a few comments along the way. Basically when you define the if clause to handle the acceleration and the deceleration, adding a simple comment above the if and else to say "# handle acceleration" and "# handle deceleration" would help clarify things. But that's just a bonus, the video is pretty clear as it is already, thanks !
@cuppixd4267
@cuppixd4267 Жыл бұрын
Was hoping for vids with godot 4, love it thx
@dev-worm
@dev-worm Жыл бұрын
many more godot 4 tutorials coming really soon!
@HagDeLioncourt
@HagDeLioncourt Ай бұрын
hi! starting to learn godot, your vids are very helpful! hope you can make a part 2 video with the sprite animations added to this code!
@enterthearcade
@enterthearcade Жыл бұрын
I was able to use this and tweak it just a little bit, but man, this is really super smooth movement. Thanks for this!
@dev-worm
@dev-worm Жыл бұрын
So glad to hear that!!
@IronModeOfficial
@IronModeOfficial Жыл бұрын
Yes man glad your back. Let’s get this goin Btw my game is almost done just need to work my inventory
@dev-worm
@dev-worm Жыл бұрын
inventory is pretty complex but im working on a video right now for the inventory system and it should be very helpful for you.
@IronModeOfficial
@IronModeOfficial Жыл бұрын
@@dev-worm I Appreciate it
@productionsinparadise2880
@productionsinparadise2880 8 ай бұрын
When I tried it. I could only move a certain amount before permanently decelerating. I would have to hit the arrow keys again to keep moving (and go even faster). It's cool, but it doesn't look like what you did in the video (or at least I don't think it does).
@lordbmc3656
@lordbmc3656 11 ай бұрын
i did every thing he did and i cant make the player move and i dont have any errors popping up what could i have done wrong
@Intergalacticprismaticcreature
@Intergalacticprismaticcreature 8 ай бұрын
im porting my scratch game to godot and this is gonna help so much!
@bubbathesomewhatreal
@bubbathesomewhatreal 4 ай бұрын
Good luck!
@kinghalls1307
@kinghalls1307 10 ай бұрын
Thank you soo much for the tutorial... Super easy to follow! I was following your other tutorial as well "how to create an rpg in godot" and I'm not sure on how to add the animations to this movement? If you could help I'd really appreciate it!
@TheEx404
@TheEx404 Жыл бұрын
Thanks, great tutorial. ❤
@dev-worm
@dev-worm Жыл бұрын
Glad it was helpful!
@MateHall
@MateHall Жыл бұрын
your so good at explaining this stuff thanks !
@dwried
@dwried 5 ай бұрын
I'm actually glad this script is broken down this way. Working on something like a top down flight game. It gave me insight on how I want to go about it now. I have to take into account airspeed and drift. Many thanks. My movement script was going to be an utter mess. Lol.
@dev-worm
@dev-worm 5 ай бұрын
so happy it was able to help!! goodluck on your game!! keep me updated on it.. Im curious now!
@JustTaaco
@JustTaaco Жыл бұрын
I'm looking very much towards tutorials on shaders for godot 4, and just more godot 4.0 tutorials in general :))
@dev-worm
@dev-worm Жыл бұрын
Going to be uploading like every other day for godot 4 tutorials
@williampoole4297
@williampoole4297 3 ай бұрын
Hey Bro. Love the video. I entered in the code just like you said however the input.x and input.y lines my int(Input doesn’t look right. On your code, int is red and Input is green. But both int and Input are green. What did I do wrong? I loaded my world and by dude didn’t move at all.
@BusterDM
@BusterDM 7 ай бұрын
this was very well explained and easy to understand for a beginner
@dev-worm
@dev-worm 7 ай бұрын
so happy to hear! thanks!
@Kxloedit
@Kxloedit Жыл бұрын
Cant describe the smile on my face after it worket thanks
@dev-worm
@dev-worm Жыл бұрын
so glad i could help :)
@kingshahzad78
@kingshahzad78 3 ай бұрын
I appreciate your logic and struggle but It flew over my brain
@Tillionz
@Tillionz Жыл бұрын
Thank you so much for this tutorial excellent descriptions and great code!!!
@0CutieCat0
@0CutieCat0 Жыл бұрын
Tutorial about Minimap with objective locations and such 👉👈
@Hawaiian.AoiTodo_808
@Hawaiian.AoiTodo_808 10 ай бұрын
It irritates the absolute frick out of me when I perfectly attempt to recreate what a turorial show. No wrong code at all. Line for line, word for word, letter for letter. Absolutely perfect. And it just doesn't work for whatever reason godot decided to just not work.
@michealarchangel637
@michealarchangel637 2 ай бұрын
Yup mine says it expects an initializer after constant name and refuses to work without it. What this initializer is fk if i know.
@Alejandro-x1i
@Alejandro-x1i 22 күн бұрын
wow man i love this code logic. thank u
@dev-worm
@dev-worm 21 күн бұрын
thank you so much! I am so happy to hear that it was helpful!
@SilverLightDungeon
@SilverLightDungeon Жыл бұрын
Look, I have this little amount of projects (maybe 3948), and I am always very anxious about the final product, and I forget that despite knowing programming, I have no idea what I am doing in a gaming creation engine. So I just threw away my pride (in a tin of pink trash) and I'm learning from zero all the basic mechanics of how to create a character. Thank you so much for helping me to create my perfect game, if I even complete a demo of the game I bring the link to those interested in knowing the project.
@dev-worm
@dev-worm Жыл бұрын
hey, glad i could help. I am really interested in knowing about the project btw
@pancake_776
@pancake_776 Жыл бұрын
Super nice tutorial! Thanks!
@dev-worm
@dev-worm 11 ай бұрын
of course anytime!
@maciold8781
@maciold8781 4 ай бұрын
Thank you, it's a great tutorial!
@dev-worm
@dev-worm 4 ай бұрын
so happy to hear that!! thank you!!
@sockretett
@sockretett 11 ай бұрын
Thanks for tutorial!
@D-Samurai
@D-Samurai 7 ай бұрын
very easy to understand thank you!!
@dev-worm
@dev-worm 7 ай бұрын
so glad to hear!! thank you! happy it helped!
@lphipps1986
@lphipps1986 Жыл бұрын
my debugger goes off the charts when i try to move. i coded everything as you did and it all checked out. but when i try to play the character doesnt move
@bobojenkins5805
@bobojenkins5805 10 ай бұрын
is there a resource that goes over all of the built in functions? No matter how good you get at coding you cant be a mind reader and know whats in all of these functions to use them. And wtf is delta?
@daemonphil3132
@daemonphil3132 5 ай бұрын
Hi, i tried to do it and my Godot is saying : Invalid call. Nonexistent function 'is_action_pressed' in base 'Vector2'... and i don't understand what to do now...
@TFAmbience
@TFAmbience 4 ай бұрын
You need to make sure you have the text exactly as shown on screen. If anything is capitalized or lower cased in the wrong spot, the function won't work
@daemonphil3132
@daemonphil3132 4 ай бұрын
@@TFAmbience
@websdevgio
@websdevgio 7 ай бұрын
i love your video it my first time in godot and was awesome
@dev-worm
@dev-worm 7 ай бұрын
thank you so much! happy to hear that!! if you ever need anything else then please let me know!! I am more than happy to help!
@Now_Roxas
@Now_Roxas Жыл бұрын
Thanks this is really helpful.
@Yinithyn
@Yinithyn 11 ай бұрын
You have this video on smoother movement, and it works! but you also have a video on animation in the other RPG series, how do i combine the two? i want this guys movement and the characters animation.
@DyIanGaming
@DyIanGaming 10 ай бұрын
Is it easy to animate the player with an animated sprite 2d and this type of movement?
@shattre6087
@shattre6087 8 ай бұрын
yes
@Soulcode-k
@Soulcode-k Ай бұрын
I made one game a pretty good one at that but I always forget the code, but I know the logic so each time I manage. But the remembering the exact code feels impossible specially when I keep learning new things. Is that ok?
@Lukydnomo
@Lukydnomo Жыл бұрын
hey bro, how would you put in code a way to change sprites or animations etc? like, for example, putting a walking animation when the character walks and such, I wrote the code and I didn't find a way to implement this "mechanic" of changing sprites and such, if you can answer me I'd appreciate it, thanks, great video
@Gameaholick
@Gameaholick Жыл бұрын
you want to declare the animations as a variable you can call so for me " @onready var _animated_sprite = $AnimatedSprite2D " then in your if function you call it to be played here is an example " if Input.is_action_pressed("right"): " and to idle you assign the idle like this " elif Input.is_action_just_released("right"):" you then repeat this for all your directions _animated_sprite.play("walkRight") _animated_sprite.play("idleRight")
@Lansamatv
@Lansamatv Жыл бұрын
you can make tutorials for a donw top shooter game
@SS.StarlightStudios
@SS.StarlightStudios Ай бұрын
Thank you!
@dev-worm
@dev-worm Ай бұрын
thank you!! Im glad it helped!
@Rotado
@Rotado 3 ай бұрын
Thank you so much :D
@dev-worm
@dev-worm 3 ай бұрын
thank you!! glad it helped!!
@BadBedroomBeatProducer
@BadBedroomBeatProducer 9 ай бұрын
I get the error "invalid call. nonexistent function 'is_action_pressed' in base 'Vector2'."
@NimmDir
@NimmDir 6 ай бұрын
Have the same issue - do you found a solution?
@BadBedroomBeatProducer
@BadBedroomBeatProducer 6 ай бұрын
Nope
@chymty6603
@chymty6603 2 ай бұрын
same issue
@chymty6603
@chymty6603 2 ай бұрын
ı found the problem well this comment was from 6 months ago but you probably wrote input instead of Input
@bloodc0re_
@bloodc0re_ Жыл бұрын
Thank you very much
@dev-worm
@dev-worm Жыл бұрын
of course anytime.
@TheTheMrbob
@TheTheMrbob 7 ай бұрын
Hey can you do a video how to do the wasd button pls bc i think thats better combos and i dont under stand how to do it thanks for an answear or a video
@dev-worm
@dev-worm 7 ай бұрын
Go to Project Setting > Input Map Tab > Type in "right" in the "Add New Action" Section. Then next to the "right" action click the + and then whatever key you want to be associated to "right" so "d"... then in code instead of saying "ui_right" just put the name of your action so for this instance put "right"...... hope that helps!!
@TheTheMrbob
@TheTheMrbob 7 ай бұрын
@@dev-worm thanks it works thank you
@alexsanderrain2980
@alexsanderrain2980 Жыл бұрын
This is pretty neat
@pytho2909
@pytho2909 9 ай бұрын
thanks for the tutorial, I learnt a lot but when I try to run the program I get the error: invalid operands 'Callable' and 'Vector2' I've double checked the code and don't think anything is wrong but it won't work, this error has been brought up in a previous comment as well, could someone please help?
@Mr.Kef_art
@Mr.Kef_art 10 ай бұрын
I'm getting an error when I press play. It says: "Invalid Call. Non existent function "is_action_pressed" in base "Vector2". Tried to fix it but I don't know what to do.
@dylanwillis3457
@dylanwillis3457 9 ай бұрын
I had the same thing happen, I just had to capitalize the i in Intput.is_action_pressed
@randomsounds2167
@randomsounds2167 Жыл бұрын
Smooth
@graso-ln8nb
@graso-ln8nb 3 ай бұрын
I doubt u'll see this, but just in case, ive been looking for a way to make the player sprite smooth, not the movement, but where's the sprite looking at, i cant find anything so this is like a last resort, thank u in advance (sorry for bad english)
@t_t_tomas
@t_t_tomas Жыл бұрын
the "velocity" variable at 11:00 is not declared anywhere, what am I missing?
@t_t_tomas
@t_t_tomas Жыл бұрын
I found the error, I updated to 4.0 and its fixed
@Agent_008
@Agent_008 7 ай бұрын
Thank you so much!!!!!
@dev-worm
@dev-worm 7 ай бұрын
of course! anytime! thank you!
@RafinCG
@RafinCG 9 ай бұрын
BEST BRO
@just_dit
@just_dit 2 ай бұрын
I don't know why, but now it doesn't work, now it's just a very fast movement of the player, no fluidity.
@marang_quntana7350
@marang_quntana7350 Жыл бұрын
Yess Godot 4.0 Les gooo
@dev-worm
@dev-worm Жыл бұрын
Godot 4 is so good
@sanitarysanchez
@sanitarysanchez Жыл бұрын
i'm getting an error message (Invalid operands 'callable' and 'Vector2' in operator '==')
@pytho2909
@pytho2909 9 ай бұрын
same here, i'm not sure what to do about it, did you manage to fix it in the end?
@gatocalcio
@gatocalcio 8 ай бұрын
@@pytho2909 pls share code for check
@peshkatfathi6661
@peshkatfathi6661 Жыл бұрын
Thanks🤘
@Valori_4
@Valori_4 Жыл бұрын
how to use a variable twice in one script ? plz telll me i need to know
@lv99redchocobo37
@lv99redchocobo37 4 ай бұрын
did i miss something? when did you define velocity? I don't see it here. how come this isn't throwing an error?
@dev-worm
@dev-worm 4 ай бұрын
you no longer have to define velocity on a characterbody2d in godot 4 like you did have to do in godot 3!!
@buttialmahairbi2854
@buttialmahairbi2854 Жыл бұрын
hey devworm can you make a video on a platformer movement please man ❤
@driescoppens834
@driescoppens834 Жыл бұрын
do you have any idea how to make sure the player can't leave the erea
@manusgraham1159
@manusgraham1159 Жыл бұрын
I tried using this code but for 3d and it works for the most part, but it seem as soon as you stop pressing an input the physics stop working, life you hold left and then let go it stops dead, but once you press a different input like down for example then it steers into it like you were holding left the entire time, it's like the game is paused when you stop pressing inputs, anyone know why that is, any help is appreciated thank you
@dev-worm
@dev-worm Жыл бұрын
Ooo im sorry i have no idea, have never played with 3d but if you check godots discord im sure someone would love to help
@mykaru3553
@mykaru3553 10 ай бұрын
For me I ran into the same issue, but I was able to fix it by setting "friction" to a very small number. Granted, I had to set my max speed to a super small number as well (0.05), but setting my friction to around this number solved the issue for me
@visibletoallusersonyoutube5928
@visibletoallusersonyoutube5928 9 ай бұрын
Happened to me too and I'm in 2d
@TrueSaLegend
@TrueSaLegend 4 ай бұрын
hey I have a problem my charakter is not moving up or down. When I press the up or down arrow I move for 1 or 2 pixels.
@dev-worm
@dev-worm 4 ай бұрын
make sure you don’t have if input.is_action_just_pressed. because if you have the “just” pressed it only calls it once instead of calling it the entire time the button is pressed down
@ignaciodangelo6385
@ignaciodangelo6385 Жыл бұрын
Great video , i have a question , velocity = velocity.limit_length(max_speed) here velocity is a Vector2d but max_speed is an integer . Why does this works and what is Godot interpreting ?
@jorijndg
@jorijndg Жыл бұрын
It's not limiting X and Y separately, but limiting the length of the vector. It's the equivalent of normalizing the vector (dividing by its length), then multiplying by the limit value, effectively setting the length to the limit value. It only does this when the length is greater than the limit value, otherwise the vector doesn't change.
@ddrruwu
@ddrruwu 4 ай бұрын
I'm pretty sure I'm using the same code but i keep getting "Invalid call. nonexistent function 'is_action_pressed' in base 'Vector 2'" any suggestions?
@dev-worm
@dev-worm 3 ай бұрын
what input is within the is_action_pressed()... did you make sure to create that as a input in the input map within the project settings?
@Platinumcan
@Platinumcan 3 ай бұрын
@@dev-worm Yeah hey, I do have the same error code showing, it shows me that its in the line 13. I did check the input map, and it looks to be right(I can be wrong) ui_up has up and the same the others. trying to find out why myself, but still no luck. I have only tried making the character movement so far in this project, and the code looks exact like the video show`s.
@ZachGamesOFFICIAL
@ZachGamesOFFICIAL 5 ай бұрын
sorry for commenting a whole year later, but i have a problem that needs to be fixed, i can't collide with anything, i tried using the move_and collide script, but it didn't work, how would i make it work?
@dev-worm
@dev-worm 5 ай бұрын
do you have a collisionshape2d within the scene? you will still beable to collide with the environment even with move and slide as long as all the objects including the player have a enabled collisionshape2d!! hope this can help! if not let me know!
@OfficialGoldenLeaf
@OfficialGoldenLeaf 10 ай бұрын
How would i go about movement without diagonals?
@kuboking2123
@kuboking2123 Жыл бұрын
I cant get it to work :( can anybody help the charcter dosent show up whenever i press the play button. EDIT: i made the player move but it dosent wanna move no matter what i do
@DRND12
@DRND12 Жыл бұрын
Thanks
@Kumo0
@Kumo0 Жыл бұрын
Can u pls make a vid about how to make a smooth jump in Godot 4
@guilhermepimenta8119
@guilhermepimenta8119 4 ай бұрын
I have a very niche problem and I can't figure it out alone In the game that im making my character can spin and move with key presses I got to a point where I have this video's movement and the rotation working (pressing f to rotate to the left and g to rotate to the right) but if iI hold both rotating buttons at the same time i can only move up for some reason . Can somebody help me with this?
@guilhermepimenta8119
@guilhermepimenta8119 4 ай бұрын
edit: It was a hardware issue :]
@SethRuh
@SethRuh 6 ай бұрын
it keeps telling me it cant find limit_length on base Vector2?
@agusnutt
@agusnutt 8 ай бұрын
Can somebody help me I need to put an animation of walking diagonally to my character, but I don't know how to put the code I want the animation to occur when pressing 2 keys
@dev-worm
@dev-worm 8 ай бұрын
I went over this in the first episode of the survival series!! and I think it is exactly what you are looking for!! I hope it helps! kzbin.info/www/bejne/m3KolpJvn6iJatU
@Ronic-gray
@Ronic-gray 2 ай бұрын
Instructions unclear ending up getting 15+ errors I'm being serious
@dev-worm
@dev-worm 2 ай бұрын
actually?? which errors?
@Ronic-gray
@Ronic-gray 2 ай бұрын
@dev-worm ok. I deleted the original code to work with something else, but there were like 18 errors, mostly just expecting a certain character or an unexpected character around line 18 and one error on line 12 about an uneven unindent. I'm new to coding so I probably just messed up somewhere but I have no idea what I did wrong.
@duck761
@duck761 Жыл бұрын
can you explain me how pressing a button changes the input and why does this "input = Input.get_vector("move_left", "move_right", "move_up", "move_down")" fuocking work
@Amazing_Software
@Amazing_Software Жыл бұрын
The "move_left" etc. are part of Godot's built in input mapping. If you open Project Settings, then Input Map, then check "Show Built-in Actions" and you can see a bunch more too. These are such standard events, that Godot bakes them in. You can define your own stuff too, or remove the built ins.
@keznoAU
@keznoAU 6 ай бұрын
ok godot just hates me i do everything correct doesnt work i copy and paste code of the internet doesnt work i look at more tutorials doesnt work like it isnt that hard to make top down movement but just why wont it work for me
@Khalid_Looby
@Khalid_Looby 9 ай бұрын
i am watching at 1080p and using upscale and i still cant see text clearly. is that I or i small? not clear.
@dev-worm
@dev-worm 9 ай бұрын
really?? I'm looking back and it is visible clearly to me... is it still like that for you?
@Khalid_Looby
@Khalid_Looby 9 ай бұрын
Yep. it is not real 1080p video. like the res is 1080 but i am sure the bitrate is not that of an actual 1080p video. I have seen 720p videos clearler than this. but it is fine. Thanks so much for your tutoiral. :)@@dev-worm
@icecoldmagic
@icecoldmagic 3 ай бұрын
is saying that my velocity is undefined and wont let me add a velocity function, variable or constant
@dev-worm
@dev-worm 3 ай бұрын
are you in godot 4?? because that seems like an error you’d get in godot 3 before the velocity was a thing. Hoping that helps you a bit
@icecoldmagic
@icecoldmagic 3 ай бұрын
@dev-worm no I'm in 4 100%
@Iettuce1
@Iettuce1 9 күн бұрын
“go dot” 💀 Jokes aside thx for the tutorial
@dev-worm
@dev-worm 5 күн бұрын
guh-dough!! I have learned!! of course anytime, I hope it helped! if you ever have any questions feel free to let me know!
@Hatsenc
@Hatsenc Жыл бұрын
Mine just crashes when I try to run the scene
@voilano6816
@voilano6816 Жыл бұрын
This whole code is without delta time, I know that move_and_slide function adds delta but only to the parameters inside right? So what are the places to put the delta if anyone konws?
@Col468
@Col468 7 ай бұрын
hold alt to resize both sides a once
@dev-worm
@dev-worm 7 ай бұрын
thanks, good tip!
@ivaneban2121
@ivaneban2121 7 ай бұрын
Can some one help me pls... i did everything as in the video but i can movie neither with WASD , mouse, with the arrows
@dev-worm
@dev-worm 7 ай бұрын
did you use "ui_up", "ui_down", etc? If so that should be the arrows and if you want WASD then you have to go into the Project settings > input map - and create new input actions. for example "right" and assign that to the "d" key. Then in the code use "if is_action_pressed("right"):"
@successspotu
@successspotu Жыл бұрын
Godot 3.5 if i create button i can also use and access by mobile game or app touch input but godot 4 i create button and export to android i can't use or access that button why any fix available please tell me
@dev-worm
@dev-worm Жыл бұрын
I’m not sure I’ll look into it because many thing have been changed
@successspotu
@successspotu Жыл бұрын
@@dev-worm yes
@successspotu
@successspotu Жыл бұрын
@@dev-worm you wil find please make a video
@dylanwillyams
@dylanwillyams Жыл бұрын
im having trouble getting this and animations to work at the same time. any tips?
@dev-worm
@dev-worm Жыл бұрын
check out a series on the channel like the "How to Create a Survival Series in Godot 4" or the "How to Make an RPG in Godot 4" Series.. in both of those I go over this pretty good!
@dylanwillyams
@dylanwillyams Жыл бұрын
@@dev-worm yeah i was trying to follow along on the rpg series. but you cant add the dir = "right" and so on in the same line as the input.x= . Basically i cant figure out how to map out the direction mapping to correspond to activating animations.
@bigdaddystrokes
@bigdaddystrokes Жыл бұрын
@@dylanwillyams Interesting. I'm currently wondering how I can get my character in the RPG tutorial to move a little more freely in all directions as right now its stuck on the "up,left,down,right" directions only and it feels pretty stiff. I'm currently following the smooth movement tutorial, but its hard to wrap my head around how I will update the "RPG" tutorial movement lol!
@999dunkins
@999dunkins 11 ай бұрын
this is way too smooth, how do you make your character stop immediately when not moving
@999dunkins
@999dunkins 11 ай бұрын
Oh you had to do something with friction, okay
@TheDoc-010
@TheDoc-010 Ай бұрын
the code is not working can anyone help me?
@pakancina3138
@pakancina3138 Жыл бұрын
what programing languige was used here?
@camy-linghoangminh7166
@camy-linghoangminh7166 11 ай бұрын
gdscript
@AzoresGS
@AzoresGS 5 ай бұрын
So how do I add animations in this code?
How to Create a DIALOGUE System in Godot 4 (step by step)
31:44
i got laid off... so i made a game...
24:08
bewky
Рет қаралды 627 М.
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,1 МЛН
Amazing remote control#devil  #lilith #funny #shorts
00:30
Devil Lilith
Рет қаралды 16 МЛН
When Cucumbers Meet PVC Pipe The Results Are Wild! 🤭
00:44
Crafty Buddy
Рет қаралды 52 МЛН
I Made My First Game in Godot in 3 Weeks...
26:21
Jack Sather
Рет қаралды 425 М.
Pixel Art Tips from a Professional Artist - Tips & Tricks
8:01
Goodgis
Рет қаралды 1,1 МЛН
Why Solo Developers Should Use Unreal
9:51
Thomas Brush
Рет қаралды 426 М.
How to Make SMOOTH Top Down Character Movement in Godot!
6:01
Can I Remake Super Mario World in Godot? (Part 1)
18:44
Godot 4 | 2D Simple Platformer Movement & Animations
14:10
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 6 МЛН
How Games Make VFX (Demonstrated in Godot 4)
5:46
PlayWithFurcifer
Рет қаралды 359 М.
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
DevLogLogan
Рет қаралды 532 М.
СКОЛЬКО ПАЛЬЦЕВ ТУТ?
00:16
Masomka
Рет қаралды 3,1 МЛН