How to Create SMOOTH Player Movement in Godot 4.0

  Рет қаралды 105,811

DevWorm

DevWorm

Күн бұрын

Пікірлер: 277
@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 Жыл бұрын
@@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 Жыл бұрын
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 11 ай бұрын
it says speed not declared
@marcosmachado6844
@marcosmachado6844 11 ай бұрын
@@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 11 ай бұрын
Add a speed variable to your character ​@@jiboodie5344
@ISAIAH_E_E
@ISAIAH_E_E 11 ай бұрын
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 11 ай бұрын
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.
@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!
@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. :)
@willbrods
@willbrods Жыл бұрын
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
@covereye5731
@covereye5731 11 ай бұрын
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
@BiffleDiffle-1
@BiffleDiffle-1 Ай бұрын
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 Ай бұрын
now that i think about it, its sub worthy, i look forward to future totorials on game code like this
@dev-worm
@dev-worm Ай бұрын
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!
@schuepbachr
@schuepbachr 3 ай бұрын
Happy to have found you- getting started on my first project ever, and tutorials like this are so freakin' helpful.
@marketwoodfarm
@marketwoodfarm 4 ай бұрын
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 4 ай бұрын
nicely done!
@yt159-sj6hd
@yt159-sj6hd Ай бұрын
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 Ай бұрын
Thanks I copy and I was my paste on my Godot 4.0
@completelyrandomlyhandlee
@completelyrandomlyhandlee 6 ай бұрын
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!
@coenraadgreyling4000
@coenraadgreyling4000 7 ай бұрын
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
@зовименяпапикс
@зовименяпапикс 3 ай бұрын
this freed my soul
@TheDawnprojekt
@TheDawnprojekt 3 ай бұрын
you can also set animatedSprite2D to be a unique name so you call it with % ?
@udtsans1138
@udtsans1138 2 ай бұрын
Do I have to add this to the bottom or top of the existing code?
@iPlay1337
@iPlay1337 Ай бұрын
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
@arukon3111
@arukon3111 Жыл бұрын
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 Жыл бұрын
so happy to hear that!
@blackjacked_xiii
@blackjacked_xiii 7 ай бұрын
I appreciate you taking the time to explain what your code means.
@dev-worm
@dev-worm 7 ай бұрын
happy to hear!! hope it helped! thank you!
@Tmaster2006YT
@Tmaster2006YT 5 ай бұрын
Thank you. This is the first coding tutorial I’ve followed that gave me a tangible result.
@dev-worm
@dev-worm 5 ай бұрын
so glad it was able out!
@cuppixd4267
@cuppixd4267 Жыл бұрын
Was hoping for vids with godot 4, love it thx
@dev-worm
@dev-worm Жыл бұрын
many more godot 4 tutorials coming really soon!
@productionsinparadise2880
@productionsinparadise2880 10 ай бұрын
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).
@HagDeLioncourt
@HagDeLioncourt 3 ай бұрын
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!
@TheEx404
@TheEx404 Жыл бұрын
Thanks, great tutorial. ❤
@dev-worm
@dev-worm Жыл бұрын
Glad it was helpful!
@kinghalls1307
@kinghalls1307 11 ай бұрын
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!
@MateHall
@MateHall Жыл бұрын
your so good at explaining this stuff thanks !
@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!!
@Intergalacticprismaticcreature
@Intergalacticprismaticcreature 9 ай бұрын
im porting my scratch game to godot and this is gonna help so much!
@bubbathesomewhatreal
@bubbathesomewhatreal 5 ай бұрын
Good luck!
@kingshahzad78
@kingshahzad78 5 ай бұрын
I appreciate your logic and struggle but It flew over my brain
@lordbmc3656
@lordbmc3656 Жыл бұрын
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
@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
@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
@Kxloedit
@Kxloedit Жыл бұрын
Cant describe the smile on my face after it worket thanks
@dev-worm
@dev-worm Жыл бұрын
so glad i could help :)
@BusterDM
@BusterDM 9 ай бұрын
this was very well explained and easy to understand for a beginner
@dev-worm
@dev-worm 9 ай бұрын
so happy to hear! thanks!
@Alejandro-x1i
@Alejandro-x1i 2 ай бұрын
wow man i love this code logic. thank u
@dev-worm
@dev-worm 2 ай бұрын
thank you so much! I am so happy to hear that it was helpful!
@dwried
@dwried 7 ай бұрын
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 7 ай бұрын
so happy it was able to help!! goodluck on your game!! keep me updated on it.. Im curious now!
@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 !
@sockretett
@sockretett Жыл бұрын
Thanks for tutorial!
@maciold8781
@maciold8781 5 ай бұрын
Thank you, it's a great tutorial!
@dev-worm
@dev-worm 5 ай бұрын
so happy to hear that!! thank you!!
@D-Samurai
@D-Samurai 9 ай бұрын
very easy to understand thank you!!
@dev-worm
@dev-worm 9 ай бұрын
so glad to hear!! thank you! happy it helped!
@pancake_776
@pancake_776 Жыл бұрын
Super nice tutorial! Thanks!
@dev-worm
@dev-worm Жыл бұрын
of course anytime!
@Yinithyn
@Yinithyn Жыл бұрын
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.
@Tillionz
@Tillionz Жыл бұрын
Thank you so much for this tutorial excellent descriptions and great code!!!
@DyIanGaming
@DyIanGaming 11 ай бұрын
Is it easy to animate the player with an animated sprite 2d and this type of movement?
@shattre6087
@shattre6087 10 ай бұрын
yes
@williampoole4297
@williampoole4297 4 ай бұрын
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.
@0CutieCat0
@0CutieCat0 Жыл бұрын
Tutorial about Minimap with objective locations and such 👉👈
@Now_Roxas
@Now_Roxas Жыл бұрын
Thanks this is really helpful.
@TheTheMrbob
@TheTheMrbob 9 ай бұрын
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 9 ай бұрын
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 9 ай бұрын
@@dev-worm thanks it works thank you
@websdevgio
@websdevgio 9 ай бұрын
i love your video it my first time in godot and was awesome
@dev-worm
@dev-worm 9 ай бұрын
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!
@Lansamatv
@Lansamatv Жыл бұрын
you can make tutorials for a donw top shooter game
@Rotado
@Rotado 5 ай бұрын
Thank you so much :D
@dev-worm
@dev-worm 5 ай бұрын
thank you!! glad it helped!!
@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")
@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
@bloodc0re_
@bloodc0re_ Жыл бұрын
Thank you very much
@dev-worm
@dev-worm Жыл бұрын
of course anytime.
@SS.StarlightStudios
@SS.StarlightStudios 2 ай бұрын
Thank you!
@dev-worm
@dev-worm 2 ай бұрын
thank you!! Im glad it helped!
@bobojenkins5805
@bobojenkins5805 11 ай бұрын
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?
@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
@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.
@Soulcode-k
@Soulcode-k 2 ай бұрын
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?
@BadBedroomBeatProducer
@BadBedroomBeatProducer 10 ай бұрын
I get the error "invalid call. nonexistent function 'is_action_pressed' in base 'Vector2'."
@NimmDir
@NimmDir 8 ай бұрын
Have the same issue - do you found a solution?
@BadBedroomBeatProducer
@BadBedroomBeatProducer 8 ай бұрын
Nope
@chymty6603
@chymty6603 4 ай бұрын
same issue
@chymty6603
@chymty6603 4 ай бұрын
ı found the problem well this comment was from 6 months ago but you probably wrote input instead of Input
@Agent_008
@Agent_008 8 ай бұрын
Thank you so much!!!!!
@dev-worm
@dev-worm 8 ай бұрын
of course! anytime! thank you!
@Hawaiian.AoiTodo_808
@Hawaiian.AoiTodo_808 11 ай бұрын
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 3 ай бұрын
Yup mine says it expects an initializer after constant name and refuses to work without it. What this initializer is fk if i know.
@buttialmahairbi2854
@buttialmahairbi2854 Жыл бұрын
hey devworm can you make a video on a platformer movement please man ❤
@daemonphil9531
@daemonphil9531 7 ай бұрын
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 6 ай бұрын
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
@daemonphil9531
@daemonphil9531 6 ай бұрын
@@TFAmbience
@Kumo0
@Kumo0 Жыл бұрын
Can u pls make a vid about how to make a smooth jump in Godot 4
@graso-ln8nb
@graso-ln8nb 5 ай бұрын
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)
@driescoppens834
@driescoppens834 Жыл бұрын
do you have any idea how to make sure the player can't leave the erea
@alexsanderrain2980
@alexsanderrain2980 Жыл бұрын
This is pretty neat
@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 Жыл бұрын
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 11 ай бұрын
Happened to me too and I'm in 2d
@EepEep-d8w
@EepEep-d8w 10 күн бұрын
could you help with an error i cant fix? extends CharacterBody2D var friction = 60 func _physics_process(delta): move(delta) var input = Vector2.ZERO func getinput(): input.x = int(Input.is_action_pressed("moveright")) - int(Input.is_action_pressed("moveleft")) input.y = int(Input.is_action_pressed("movedown")) - int(Input.is_action_pressed("moveup")) return input.normalized func move(delta): input = getinput() if input == (Vector2.ZERO): # this line has an error if velocity.length() > (friction * delta): velocity -= velocity.normalized() * (friction * delta) else: velocity = Vector2.ZERO else: velocity += (input * 10 * delta) velocity = velocity.limit_length(20) move_and_slide() this is the code i made with this tutorial, but its giving an error on line 15 because of invalid operands. do you know what the issue is?
@dev-worm
@dev-worm 8 күн бұрын
I see! you put "input = getinput()" instead of "input = get_input()". You are missing that underscore in between get and input. and since getinput() isn't a valid operand but a made up one you are receiving that error. I hope that helps!
@EepEep-d8w
@EepEep-d8w 8 күн бұрын
@@dev-worm thanks
@pytho2909
@pytho2909 11 ай бұрын
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?
@lv99redchocobo
@lv99redchocobo 6 ай бұрын
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 6 ай бұрын
you no longer have to define velocity on a characterbody2d in godot 4 like you did have to do in godot 3!!
@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!
@Valori_4
@Valori_4 Жыл бұрын
how to use a variable twice in one script ? plz telll me i need to know
@sanitarysanchez
@sanitarysanchez Жыл бұрын
i'm getting an error message (Invalid operands 'callable' and 'Vector2' in operator '==')
@pytho2909
@pytho2909 11 ай бұрын
same here, i'm not sure what to do about it, did you manage to fix it in the end?
@gatocalcio
@gatocalcio 10 ай бұрын
@@pytho2909 pls share code for check
@peshkatfathi6661
@peshkatfathi6661 Жыл бұрын
Thanks🤘
@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
@marang_quntana7350
@marang_quntana7350 Жыл бұрын
Yess Godot 4.0 Les gooo
@dev-worm
@dev-worm Жыл бұрын
Godot 4 is so good
@Violet_fykshyn
@Violet_fykshyn 3 ай бұрын
getting annoyed at all these videos that will just not explain the what or why of anything. I've watched multiple tutorials on this and each one has used a different method and not a single one has explained it. Saying what you type as you type it doesn't actually explain anything just an fyi
@foxxtronix6556
@foxxtronix6556 11 күн бұрын
watch coco code he does it perfectly and he gives you chances to do it on your own when you do somethinf more then once
@Khalid_Looby
@Khalid_Looby 10 ай бұрын
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 10 ай бұрын
really?? I'm looking back and it is visible clearly to me... is it still like that for you?
@Khalid_Looby
@Khalid_Looby 10 ай бұрын
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
@OfficialGoldenLeaf
@OfficialGoldenLeaf Жыл бұрын
How would i go about movement without diagonals?
@TrueSaLegend
@TrueSaLegend 6 ай бұрын
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 6 ай бұрын
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
@Col468
@Col468 8 ай бұрын
hold alt to resize both sides a once
@dev-worm
@dev-worm 8 ай бұрын
thanks, good tip!
@Mr.Kef_art
@Mr.Kef_art Жыл бұрын
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 10 ай бұрын
I had the same thing happen, I just had to capitalize the i in Intput.is_action_pressed
@guilhermepimenta8119
@guilhermepimenta8119 6 ай бұрын
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 6 ай бұрын
edit: It was a hardware issue :]
@ZachGamesOFFICIAL
@ZachGamesOFFICIAL 6 ай бұрын
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 6 ай бұрын
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!
@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.
@pakancina3138
@pakancina3138 Жыл бұрын
what programing languige was used here?
@camy-linghoangminh7166
@camy-linghoangminh7166 Жыл бұрын
gdscript
@Ronic-gray
@Ronic-gray 4 ай бұрын
Instructions unclear ending up getting 15+ errors I'm being serious
@dev-worm
@dev-worm 4 ай бұрын
actually?? which errors?
@Ronic-gray
@Ronic-gray 4 ай бұрын
@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.
@ddrruwu
@ddrruwu 5 ай бұрын
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 5 ай бұрын
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 5 ай бұрын
@@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.
@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?
@icecoldmagic
@icecoldmagic 5 ай бұрын
is saying that my velocity is undefined and wont let me add a velocity function, variable or constant
@dev-worm
@dev-worm 5 ай бұрын
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 5 ай бұрын
@dev-worm no I'm in 4 100%
@SethRuh
@SethRuh 7 ай бұрын
it keeps telling me it cant find limit_length on base Vector2?
@agusnutt
@agusnutt 9 ай бұрын
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 9 ай бұрын
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
@davebot_30
@davebot_30 Жыл бұрын
where was the bit where you bind the keys
@dev-worm
@dev-worm Жыл бұрын
in the setting and then under the "input map" tab!
@davebot_30
@davebot_30 Жыл бұрын
Thanks
@ivaneban2121
@ivaneban2121 8 ай бұрын
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 8 ай бұрын
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"):"
@999dunkins
@999dunkins Жыл бұрын
this is way too smooth, how do you make your character stop immediately when not moving
@999dunkins
@999dunkins Жыл бұрын
Oh you had to do something with friction, okay
@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
@RafinCG
@RafinCG 10 ай бұрын
BEST BRO
@Hatsenc
@Hatsenc Жыл бұрын
Mine just crashes when I try to run the scene
@kompetenzbox
@kompetenzbox Ай бұрын
“go dot” 💀 Jokes aside thx for the tutorial
@dev-worm
@dev-worm Ай бұрын
guh-dough!! I have learned!! of course anytime, I hope it helped! if you ever have any questions feel free to let me know!
@randomsounds2167
@randomsounds2167 Жыл бұрын
Smooth
@Simon-xi7lb
@Simon-xi7lb Жыл бұрын
14:50 "we can go to our world and play" bruh but HOW?? WHAT? what button did you press wtf?!
@dev-worm
@dev-worm Жыл бұрын
the play button at the very top of the screen or F6
@Simon-xi7lb
@Simon-xi7lb Жыл бұрын
@@dev-worm thanks bro!
@hardmave
@hardmave Жыл бұрын
I need to spam it before i move and i move really slowly
@dev-worm
@dev-worm Жыл бұрын
its because you might be useing if Input.is_action_just_pressed(xxxxx) instead of the one im using inside of this tutorial
@gman8398
@gman8398 Жыл бұрын
is there a way to not normalize the movement?
How to Create a DIALOGUE System in Godot 4 (step by step)
31:44
The Tools I Use For Full Time Indie Game Development
12:09
Firebelley Games
Рет қаралды 72 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
I made a game using Godot for the first time
7:35
shawcat
Рет қаралды 1,4 МЛН
Godot Scripts I add to Every Game
12:34
Aarimous
Рет қаралды 61 М.
THIS Is The Key To Good UIs in Godot
9:39
Mina Pêcheux
Рет қаралды 7 М.
4 Godot 4 Devs Make 4 Games in 44 Hours
25:19
DevLogLogan
Рет қаралды 535 М.
How to Add Interaction in Godot 4
16:48
Nagi
Рет қаралды 27 М.
I Made the Same Game in 8 Engines
12:34
Emeral
Рет қаралды 4,3 МЛН
I Made My First Game in Godot in 3 Weeks...
26:21
Jack Sather
Рет қаралды 474 М.
I Made a Graphics Engine in Scratch
8:27
Zyger
Рет қаралды 205 М.
How Games Make VFX (Demonstrated in Godot 4)
5:46
PlayWithFurcifer
Рет қаралды 369 М.
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН