This is Episode 1 of the Survival Series. Complete Survival Series Playlist: th-cam.com/play/PL3cGrGHvkwn2NOT1LSwf5d2XZmlc5Bjsn.html Hope this series helps!
Hi, I'm 50+ and just started my “Game Dev” journey. In real life, I work with humans, not machines, so this is a great way to compensate. I came across Godot 4 just a few weeks ago, and your 2D tutorials have already helped me tremendously in making progress. This old man is just picking up a new hobby, I guess. Thank you for your inspiring work!
If anyone would like the script , its here also if you find that you cant move be sure you go to steam and right click the game go to properties and choose betas 4.0, i cant seem to get it to walk with newer versions (line 8 you can copy and paste ("left", "right", "up", "down") instead of ("ui_left", "ui_right", "ui_up", "ui_down") if you like WASD controls extends CharacterBody2D var speed = 100 var player_state func _physics_process(_delta): var direction = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") # replace with ("left", "right", "up", "down") if you like "WASD" controls if direction.x == 0 and direction.y == 0: player_state = "idle" elif direction.x != 0 or direction.y != 0: player_state = "walking" velocity = direction * speed
if player_state == "idle": $AnimatedSprite2D.play("idle") if player_state == "walking": if dir.y == -1: $AnimatedSprite2D.play("n-walk") if dir.x == 1: $AnimatedSprite2D.play("e-walk") if dir.y == 1: $AnimatedSprite2D.play("s-walk") if dir.x == -1: $AnimatedSprite2D.play("w-walk")
if dir.x > 0.5 and dir.y < -0.5: $AnimatedSprite2D.play("ne-walk") if dir.x > 0.5 and dir.y > 0.5: $AnimatedSprite2D.play("se-walk") if dir.x < -0.5 and dir.y > 0.5: $AnimatedSprite2D.play("sw-walk") if dir.x < -0.5 and dir.y < -0.5: $AnimatedSprite2D.play("nw-walk") func player(): pass
Nice! Can't wait to see everthing you can do in this series! As someone who searched A LOT about inventory tutorials, the only thing that it seems to be missing on every video I watch its the equipment management window, that whenever you equip an item, it shows on another window in your character like in WoW, if you manage to implement that I'm pretty sure it's gonna blow up even more now that unity is dying on its own
Quick tips: The lines 10, 11, 12 and 13 in the minute 11:30 could be replaced by: player_state = "idle" if (direction == Vector2.ZERO) else "walking" Also, I think you can make 8 directional movement using the AnimationTree's BlendSpace2D instead of using a bunch of IFs. But for that, the AnimatedSprite2D would have to be replaced by a Sprite2D and an AnimationPlayer. Anyways, great video, keep it up
Bro, you have no idea how much I love you. Ever since the mainstream tutorial makers like gdquest and game endeavour fell off, its been so hard to do godot, but your channel is amazing. Insane editing, high quality. not only that, but your tutorials are the only ones that seem to consistently work EVERY SINGLE TIME. With this quality, and godots increased user amount after unity shot themselves in the foot, your going places. Keep it up❤
Hey all a quick tip when loading a sprite sheet like that. If you name all of the animations you are going to add first then follow all of his steps: Going into the animation and adding frames You won't have to resize your sheet everytime. Thanks so much for this series it's a life saver! Hope this helps!!!
sorry for the wait.. the inventory system took a while lol, i hope it’s helpful… let me know if you have any issues with anything :) thanks for watching it means the world to me!
Thanks! your videos are very helpful. After listening to your tips video I decided to try the task you talked about. Before you do some process like (creating movement/specific logic) I pause video, try doing it myself doesn't matter if I fail or not after trying myself I then check your take on matter. It really help me organize my take on specific tasks and find new ways to go about approaching the problem. And here's my take on movement logic func _physics_process(delta): movement() func movement(): velocity = Vector2.ZERO velocity = Input.get_vector("left", "right", "up", "down") play_animation() velocity = velocity.normalized() * SPEED move_and_collide(velocity) func play_animation(): if velocity == Vector2.ZERO: player_animation.play("idle") else: var side: String = get_side() player_animation.play("%s-walk" % side) func get_side() -> String: var position_x: String = "" var position_y: String = "" if velocity.x < 0: position_x = "w" elif velocity.x > 0: position_x = "e" if velocity.y < 0: position_y = "n" elif velocity.y > 0: position_y = "s" return position_y + position_x
@dev-worm Thanks so much for your tutorials! This is my first shot at Godot, and really still a noob at all of this. You make it all simple for us to understand. Many thanks! To anyone who may need help with this. I had a problem with by the end of the video, my character was still stuck at the "0,0" or top right of the world. I'm not sure if this is because of a Godot update or not but when dev-worm added the camera everything was seamless for him. this fix- In the beginning when we did our first look into the debug it asked us to make a main scene which was our character at the time. So if your issue is no Camera2D zoom, and the character sits at "0,0", then we need to change your "Main Scene". It took me 30 mins to figure this out. first by restarting a new project, then when it got to the "Main Scene" prompt the lightbulb lit up. never give up and god's speed on your journeys! below is the fix. Just go to Project Settings | General (tab) | Application | Run and set Main Scene to whatever scene you want to start when you press Play
Man.. This is so good! Exactly what I am looking for! If one day you could show how to make system for crafting (for example cut tree for branch, something else for to make rope and rope plus branch would make bow etc... That would be amazing. Just suggestion!
Your vids are so great and easy to follow! I'm a first time dev at 40 and these vids have certainly sped up the process to one day build my dream game! Once I finish your other series on building a 2d game I'm onto this one after! Great job!
I worked on it all day. When I was halfway satisfied, I stopped and relaxed for the day. I just saw your video by chance and am happy, but also a bit sad. 14 hours late xD thank you! realy good
@@dev-worm I didn't want to just copy it, so I worked for a few hours today to revise my code with the new knowledge from you. This is my result: extends CharacterBody2D @onready var animation_player = $AnimationPlayer @export var speed = 250 func _physics_process(delta): move_player()
func move_player(): var direction = Input.get_vector("left", "right", "up", "down")
if Input.is_action_just_released("right"): animation_player.play("idl_right") if Input.is_action_just_released("left"): animation_player.play("idl_left") if Input.is_action_just_released("down"): animation_player.play("idl_down") if Input.is_action_just_released("up"): animation_player.play("idl_up")
if direction.x == 1: animation_player.play("walk_right") if direction.x == -1: animation_player.play("walk_left") if direction.y == 1: animation_player.play("walk_down") if direction.y == -1: animation_player.play("walk_up")
if (direction.y < 0 or direction.y > 0) and direction.x < 0: animation_player.play("walk_left") if (direction.y < 0 or direction.y > 0) and direction.x > 0: animation_player.play("walk_right")
Thank you sooo much, I really appreaciate you make this videos, this is exactly what I was looking for to learn, please continue with the serie, me and many people learn a lot with your videos🤩
I'm fading into sad And there's nothing I can do Then out on the sky like a flash Sending me high, high, high You rescue me You saved me from a certain tragedy Godot python syntax is very easy to learn, thanks for the tutorials
Thank you for the awesome tutorials! They are incredibly helpful and easy to understand :) I've been following your actions and adding a bit of complexity/external things to my code, so if anyone here like me is also figuring out controller input support, here is how I got all 8 directional animations working with the left stick: if player_state == "walking": if dir.x > -0.25 and dir.x < 0.25 and dir.y < 0: $AnimatedSprite2D.play("n-walk") if dir.y > -0.25 and dir.y < 0.25 and dir.x > 0: $AnimatedSprite2D.play("e-walk") if dir.x > -0.25 and dir.x < 0.25 and dir.y > 0: $AnimatedSprite2D.play("s-walk") if dir.y > -0.25 and dir.y < 0.25 and dir.x < 0: $AnimatedSprite2D.play("w-walk")
if dir.x > 0.5 and dir.y < -0.5: $AnimatedSprite2D.play("ne-walk") if dir.x > 0.5 and dir.y > 0.5: $AnimatedSprite2D.play("se-walk") if dir.x < -0.5 and dir.y > 0.5: $AnimatedSprite2D.play("sw-walk") if dir.x < -0.5 and dir.y < -0.5: $AnimatedSprite2D.play("nw-walk")
just a quick update for anyone who only gets the first frame played, the code above worked in godot 4.0 but they changed smth in godot 4.3, to fix this: add another var (below player_state) called current_animation = "" and change your functions to look like this: func play_anim(dir): if player_state == "idle": change_animation("idle") elif player_state == "walking": if dir.y == -1: change_animation("n-walk") elif dir.x == 1: change_animation("e-walk") elif dir.y == 1: change_animation("s-walk") elif dir.x == -1: change_animation("w-walk") elif dir.x > 0.5 and dir.y < -0.5: change_animation("ne-walk") elif dir.x > 0.5 and dir.y > 0.5: change_animation("se-walk") elif dir.x < -0.5 and dir.y > 0.5: change_animation("sw-walk") elif dir.x < -0.5 and dir.y < -0.5: change_animation("nw-walk") func player(): pass func change_animation(new_animation): if current_animation != new_animation: current_animation = new_animation $AnimatedSprite2D.play(current_animation) what this does, it ensures that the animations don't overlap and restart eachother as if u have multiple if's all of them will be ran in a sequence, when you use if && elif, only one will play at a time
well my first game that in my mind is something like survival but with a twist so this might be a huge help for me you gained a new subscriber ❤😊🎉 keep going man
I am so happy to hear that!! it is an honor to hear that!! it really means the world!! I hope the entire series is able to help you!! and if you have any questions please let me know!
I had a question it will be great if u could answer this sir. For the animation why not just listen on event such as left right up down click inputs, and then just Play the animation accordingly? That will be easy to read code.
Man thanks for this tutorial, Im learning a lot from it, I also thank Godot for making it to where you dont have to manually enter the pixel height and width no more on the individual sprite sheets... once you set it once it follows the same everytime you open that file for animation frames. Really cool, Im excited to learn more about animation in Godot engine it seems very robust, I am also kinda wondering about easiest way to add animation embellishments to background elements such as random birds flying over head or maybe wind blown leaves occasionally... if you ever get the chance to showcase that in a tutorial I would love to see it implemented.
Great series! I'll make one suggestion, try structuring your player movement a bit differently in regards to what sprite is called. Long if/elif blocks are kinda hard to read.
@@dev-worm thanks for responding! Just getting into godot, so binging content while my new processor ships. I'm a couple videos in on this, and love it so far. We're planning on making a 3d game, but your videos are great to learn how to navigate, and structure files. Thanks again brother
Tired of entering the sprites row and column count over and over? Duplicate the "AnimatedSprite2D" as a child of the "AnimatiedSprite2D", add all your frames in the child node, and it will remember the rows and columns you entered. When done just move the child node under player and delete the parent AnimatiedSprite2D node...... Know idea why it's that way, but it makes the process so much faster for me. I hope they add this soon as standard behaviour and also zoom with mouse-scroll while in the spriteFrame view.
Devworm i followed everything in your video up until 11:40 when you tested the movement but my chracter doesnt move i think it might be that godot isnt detecting my keyboard inputs do you know how i could fix this?
Love the content so far. One word of advice that might help you type better and will make your videos more appealing and easier for old guys like me to follow is just to slow down a little. You move really fast through process which tells me you know what you are doing but it can take more time to continue backspacing so much when you are typing too fast. Take or leave it. I will be watching this full series. Thanks!
Hey devworm, I have a problem. The camera2d is not working. I set it as child of player, enable it as current camera and even tried to script one to follow player. Nothing is working
I hade problems with the idle state, so I needed to ad this if direction.x == 0 and direction.y == 0: if player_state != "idle": player_state = "idle" play_anim(direction) previous_direction = direction elif direction.x != 0 or direction.y != 0: player_state = "walking"
Thanks for your tutorials, I will be following it! I was wondering if you could make a tutorial to make custscenes and trigger events(like stardew valley) for Godot 4. I can't find this tutorial and I am a newbie
I got a idle animation where the sprite is turned to different direction how do I set it up so the sprite stays turn when the walking animation is over?
i had an suggestion for maybe a future youtube tutorial project, it would be also very cool if you would make like an 3d but not really 3d game tutorial with godot. like for instance a 3d world but with 2d sprites. like paper marion or mario rpg
Hey, sorry to bother you Sir. I am just wondering if I am able to use your tutorials for making a game and if I have to provide credit (Mandatory)? Thanks
Please put all art in 1 zip file next time please. I'm lazy! :-) After completing this tutorial, I almost gave up but I fixed my issue. I changed player_state = "idle" to something else completely different because it was confusing and made me think it was attached to the (Idle animation) we made. I noticed that the player_state = "IDLE" is useless because we would've needed the same amount of "if" statements we used to make the character walk but that wasn't shown in this video. Anyways on to the next video!!
Hi! i found your tutorial very helpful even for unexperienced games dev like me, but I have one question... so i made an idle animation for my character in every direction can you show us how to apply it in the Gdscript so whenever the player faces a different direction the idle animation changes? as example if i face east the east idle animation plays and so long... and thanks
I don't know if my code is wrong or something i did wrong but i need to mention that whenever i click the left, right, up, down button for movement my character animation doesn't play all the corner walking animations works but when i click all the buttons by holding it and stop and only holding left the animation of left plays but when i only click the left button the animation doesn't work it also doesn't work with all movement button right, up and down
isn't there an easier way to import the animations rather than entering the 20/8 over and over again , just wondering anyway i appreciate your work thanx for the effort
not the end.. i’ll add more stuff most likely like a crafting system and other stuff that goes well with the game.. that’s just the basic prototype of it :)
Hey you should add a $ symbol so people can give you gratitude money. Some would prefer that over a subscription. Thanks for this video series. Exactly what I was looking for!
tried today with basic up-down-right-left animation only and with a sprite sheet of mine 32x32, i have done everything as in the video, i can correctly move the player in every direction BUT animations go mad, sometimems they work, sometimes only one stucks, etc..honestly i don't know what's wrong, maybe some of you can gime me some clues? (godot 4.2.1 win 64)
i've been looking all over for a comprehensive tutorial like this one but i absolutely cannot stand video tutorials. i cannot learn from them in a way that matters. is there a pdf version with screenshots and comprehensive step-by-step text explanations?
not for this series! but im working on another series and trying to get it out this weekend! Ill make a pdf version of my tutorial and upload it somewhere to download
@@dev-worm duly noted! i've been biting the bullet and following along step by step with you the last few days -- just so you know (you may wanna add a note somewhere in the descriptions or something): theres a bug in v4.2.1 that doesnt pull up variables of objects in the autocomplete. this bug has been fixed as of v4.2.2 i spent several hours trying to figure it out yesterday while following part 6 of this one. (i'd been brute forcing and trusting the process up until then) dunno how relevant that's gonna be for you but its something i tripped on!
not sure if you can help on this, im a begginer learning as we go and for some reason my Camera2d wont work? no matter what i do it doesnt center the player or zoom in like yours does and i was making sure i did everything you do to make it work? im having abit of trouble? lol thankyou!
@@Beeaannsss Yeah i am not sure why.. i have another project that im working on and its woking perfect, but on this one it just wont work... if there is anyone that can give us some advice it would be amazing!
I wonder if there is no other way for the 8-way animation? Do you really have to create each direction as an extra animation for each character individually? And also for each attack, etc.? If you do this for 5 characters, for example, you have to make 80 individual animations. If you have even more attacks or movements, you are at several hundred individual animations. Is that really the case with Godot, that it's such a hassle?
This is Episode 1 of the Survival Series.
Complete Survival Series Playlist: th-cam.com/play/PL3cGrGHvkwn2NOT1LSwf5d2XZmlc5Bjsn.html
Hope this series helps!
i will see all
I think its French so ga-DOH or GOD-oh, no hard 't'
Hi, I'm 50+ and just started my “Game Dev” journey.
In real life, I work with humans, not machines, so this is a great way to compensate. I came across Godot 4 just a few weeks ago, and your 2D tutorials have already helped me tremendously in making progress. This old man is just picking up a new hobby, I guess. Thank you for your inspiring work!
so happy to hear that! I'm wishing you only the best.. if you ever need anything then please let me know! id be so happy to help!
If anyone would like the script , its here also if you find that you cant move be sure you go to steam and right click the game go to properties and choose betas 4.0, i cant seem to get it to walk with newer versions (line 8 you can copy and paste ("left", "right", "up", "down") instead of ("ui_left", "ui_right", "ui_up", "ui_down") if you like WASD controls
extends CharacterBody2D
var speed = 100
var player_state
func _physics_process(_delta):
var direction = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") # replace with ("left", "right", "up", "down") if you like "WASD" controls
if direction.x == 0 and direction.y == 0:
player_state = "idle"
elif direction.x != 0 or direction.y != 0:
player_state = "walking"
velocity = direction * speed
move_and_slide()
play_anim(direction)
func play_anim(dir):
if player_state == "idle":
$AnimatedSprite2D.play("idle")
if player_state == "walking":
if dir.y == -1:
$AnimatedSprite2D.play("n-walk")
if dir.x == 1:
$AnimatedSprite2D.play("e-walk")
if dir.y == 1:
$AnimatedSprite2D.play("s-walk")
if dir.x == -1:
$AnimatedSprite2D.play("w-walk")
if dir.x > 0.5 and dir.y < -0.5:
$AnimatedSprite2D.play("ne-walk")
if dir.x > 0.5 and dir.y > 0.5:
$AnimatedSprite2D.play("se-walk")
if dir.x < -0.5 and dir.y > 0.5:
$AnimatedSprite2D.play("sw-walk")
if dir.x < -0.5 and dir.y < -0.5:
$AnimatedSprite2D.play("nw-walk")
func player():
pass
ty this helps, was wondering why the animations wernt working lol
Thank you. I had an and instead of an or in the elif statement and it was messing me up. Your post helped me find it.
With the attention Godot has been getting lately because of Unity's downfall, this channel might blow up.
I hope so. I enjoy how @dev-worm explains his videos.
Will*
@@_xtel Me too. I hope newcomers give GDScript a fair chance.
we can only hope, i love this engine so far and @dev-worm explains things so a total noob like me can understand it
Will definitely * 😀
Nice! Can't wait to see everthing you can do in this series! As someone who searched A LOT about inventory tutorials, the only thing that it seems to be missing on every video I watch its the equipment management window, that whenever you equip an item, it shows on another window in your character like in WoW, if you manage to implement that I'm pretty sure it's gonna blow up even more now that unity is dying on its own
i’ll work on adding that feature to it right now
and don't forget to use velocity.normalized() so ur diagonal speed stays correct
Quick tips:
The lines 10, 11, 12 and 13 in the minute 11:30 could be replaced by:
player_state = "idle" if (direction == Vector2.ZERO) else "walking"
Also, I think you can make 8 directional movement using the AnimationTree's BlendSpace2D instead of using a bunch of IFs. But for that, the AnimatedSprite2D would have to be replaced by a Sprite2D and an AnimationPlayer.
Anyways, great video, keep it up
your completely right, thanks for pointing that out
Will you please be so kind as to elaborate a bit more on the BlendSpace2D method?
Bro, you have no idea how much I love you. Ever since the mainstream tutorial makers like gdquest and game endeavour fell off, its been so hard to do godot, but your channel is amazing. Insane editing, high quality. not only that, but your tutorials are the only ones that seem to consistently work EVERY SINGLE TIME. With this quality, and godots increased user amount after unity shot themselves in the foot, your going places. Keep it up❤
So happy to hear that! Im working on becoming consistent so im able to upload more godot videos and help out the community on a higher level!
Hey all a quick tip when loading a sprite sheet like that. If you name all of the animations you are going to add first then follow all of his steps:
Going into the animation and adding frames
You won't have to resize your sheet everytime.
Thanks so much for this series it's a life saver!
Hope this helps!!!
This guy is great i wish his channel will be very popular in the near future :P
It is soo good i waited for this soo long, now I know why you made us wait. It is very cool.
sorry for the wait.. the inventory system took a while lol, i hope it’s helpful… let me know if you have any issues with anything :) thanks for watching it means the world to me!
@@dev-worm no worries you always come up with good ideas I actually appreciate that. 😄
Hope your channel gets bigger and bigger the more attention godot gets, man. You deserve it.
I appreciate that!
You have help my journey to make fun games I will always remember this❤
By the way what is the upload schedule as i am new here
trying for every other day! haven’t been consistent but i’m going to stay consistent the next couple months and upload 3-4 videos a week!
Thanks! your videos are very helpful.
After listening to your tips video I decided to try the task you talked about. Before you do some process like (creating movement/specific logic) I pause video, try doing it myself doesn't matter if I fail or not after trying myself I then check your take on matter. It really help me organize my take on specific tasks and find new ways to go about approaching the problem.
And here's my take on movement logic
func _physics_process(delta):
movement()
func movement():
velocity = Vector2.ZERO
velocity = Input.get_vector("left", "right", "up", "down")
play_animation()
velocity = velocity.normalized() * SPEED
move_and_collide(velocity)
func play_animation():
if velocity == Vector2.ZERO:
player_animation.play("idle")
else:
var side: String = get_side()
player_animation.play("%s-walk" % side)
func get_side() -> String:
var position_x: String = ""
var position_y: String = ""
if velocity.x < 0:
position_x = "w"
elif velocity.x > 0:
position_x = "e"
if velocity.y < 0:
position_y = "n"
elif velocity.y > 0:
position_y = "s"
return position_y + position_x
it looks good! glad you were able to go about it on your own.. it is so amazing to hear! thank you for updating me on your journey!
I've got to say that your presentation style really comes off as approachable.
Love these tutorials by DevWorm
thank you, this makes me smile so much, if you ever need anything then please let me know!
Great start to this series, can't wait to do the rest
goodluck!! if you need help with anything in the rest of the series then let me know!
@dev-worm Thanks so much for your tutorials!
This is my first shot at Godot, and really still a noob at all of this.
You make it all simple for us to understand. Many thanks!
To anyone who may need help with this.
I had a problem with by the end of the video, my character was still stuck at the "0,0" or top right of the world.
I'm not sure if this is because of a Godot update or not but when dev-worm added the camera everything was seamless for him.
this fix-
In the beginning when we did our first look into the debug it asked us to make a main scene which was our character at the time.
So if your issue is no Camera2D zoom, and the character sits at "0,0", then we need to change your "Main Scene".
It took me 30 mins to figure this out. first by restarting a new project, then when it got to the "Main Scene" prompt
the lightbulb lit up. never give up and god's speed on your journeys! below is the fix.
Just go to Project Settings | General (tab) | Application | Run and set Main Scene to whatever scene you want to start when you press Play
thank you so much for pointing all this info out to others!! it is amazing to see this sort of community surrounding Godot!
Much love! I was slowly derping around the tabs to see if I could figure out why mine wasn't zooming in lol amazing GoDot community =)
Went through your RPG series, and it really really helped. Starting this one today, with the release of godot 4.2 stable (yay!) and I'm excited!
Man.. This is so good! Exactly what I am looking for! If one day you could show how to make system for crafting (for example cut tree for branch, something else for to make rope and rope plus branch would make bow etc... That would be amazing. Just suggestion!
YES!
Your vids are so great and easy to follow! I'm a first time dev at 40 and these vids have certainly sped up the process to one day build my dream game! Once I finish your other series on building a 2d game I'm onto this one after! Great job!
so happy to hear that! Glad I'm able to help! Thank you so much!
I worked on it all day. When I was halfway satisfied, I stopped and relaxed for the day.
I just saw your video by chance and am happy, but also a bit sad. 14 hours late xD
thank you! realy good
of course, anytime! I'm gald I was able to help... but not glad that i wasnt able to help 14 hours earlier lol
@@dev-worm 😂
@@dev-worm I didn't want to just copy it, so I worked for a few hours today to revise my code with the new knowledge from you.
This is my result:
extends CharacterBody2D
@onready var animation_player = $AnimationPlayer
@export var speed = 250
func _physics_process(delta):
move_player()
func move_player():
var direction = Input.get_vector("left", "right", "up", "down")
if Input.is_action_just_released("right"):
animation_player.play("idl_right")
if Input.is_action_just_released("left"):
animation_player.play("idl_left")
if Input.is_action_just_released("down"):
animation_player.play("idl_down")
if Input.is_action_just_released("up"):
animation_player.play("idl_up")
if direction.x == 1:
animation_player.play("walk_right")
if direction.x == -1:
animation_player.play("walk_left")
if direction.y == 1:
animation_player.play("walk_down")
if direction.y == -1:
animation_player.play("walk_up")
if (direction.y < 0 or direction.y > 0) and direction.x < 0:
animation_player.play("walk_left")
if (direction.y < 0 or direction.y > 0) and direction.x > 0:
animation_player.play("walk_right")
velocity = direction * speed
move_and_slide()
This could help me a lot, thanks for all the dedication in your videos, I sub!
Thanks, it means the world. If you have any questions then please let me know!
Thank you sooo much, I really appreaciate you make this videos, this is exactly what I was looking for to learn, please continue with the serie, me and many people learn a lot with your videos🤩
next episode is tomorrow and then all the rest will be uploaded every other day!
Awesome tutorial, thank you very much! Looking forward to new episodes ^))
You dropped this 👑
haha thank you so much!
What i love in your tutorial is that you explained all things you do it in game
All support to you bro❤❤
I'm fading into sad
And there's nothing I can do
Then out on the sky like a flash
Sending me high, high, high
You rescue me
You saved me from a certain tragedy
Godot python syntax is very easy to learn, thanks for the tutorials
haha love it!! glad i was able to help! thanks for the little poem!!
@@dev-worm it's the song message from the stars
As always your tutorials are just great ! Thanks for your work 🎉
so glad to hear that!! if you need help with anything then please let me know!
appreciate you putting this series up!
glad to have you teach me godot bro. thanks, good work, and keep it up!!!
thanks!! Im so glad to hear that! If you ever need anything then please let me know!
I like that I hope u will get bigger with new godot users
Much cleaner way to handle animation with diagonals :
func play_animation(direction):
if player_state == "idle":
$AnimatedSprite2D.play("idle")
if player_state == "walking":
var cardinal_direction = ""
if direction.y > 0:
cardinal_direction += "s"
elif direction.y < 0:
cardinal_direction += "n"
if direction.x > 0:
cardinal_direction += "e"
elif direction.x < 0:
cardinal_direction += "w"
$AnimatedSprite2D.play(cardinal_direction + "-walk")
thank you so much!
Thank you for this series ... May you channel Grow ✨
thank you!! it means the world!!
Thank you for the awesome tutorials! They are incredibly helpful and easy to understand :)
I've been following your actions and adding a bit of complexity/external things to my code, so if anyone here like me is also figuring out controller input support, here is how I got all 8 directional animations working with the left stick:
if player_state == "walking":
if dir.x > -0.25 and dir.x < 0.25 and dir.y < 0:
$AnimatedSprite2D.play("n-walk")
if dir.y > -0.25 and dir.y < 0.25 and dir.x > 0:
$AnimatedSprite2D.play("e-walk")
if dir.x > -0.25 and dir.x < 0.25 and dir.y > 0:
$AnimatedSprite2D.play("s-walk")
if dir.y > -0.25 and dir.y < 0.25 and dir.x < 0:
$AnimatedSprite2D.play("w-walk")
if dir.x > 0.5 and dir.y < -0.5:
$AnimatedSprite2D.play("ne-walk")
if dir.x > 0.5 and dir.y > 0.5:
$AnimatedSprite2D.play("se-walk")
if dir.x < -0.5 and dir.y > 0.5:
$AnimatedSprite2D.play("sw-walk")
if dir.x < -0.5 and dir.y < -0.5:
$AnimatedSprite2D.play("nw-walk")
just a quick update for anyone who only gets the first frame played, the code above worked in godot 4.0 but they changed smth in godot 4.3, to fix this:
add another var (below player_state) called current_animation = "" and change your functions to look like this:
func play_anim(dir):
if player_state == "idle":
change_animation("idle")
elif player_state == "walking":
if dir.y == -1:
change_animation("n-walk")
elif dir.x == 1:
change_animation("e-walk")
elif dir.y == 1:
change_animation("s-walk")
elif dir.x == -1:
change_animation("w-walk")
elif dir.x > 0.5 and dir.y < -0.5:
change_animation("ne-walk")
elif dir.x > 0.5 and dir.y > 0.5:
change_animation("se-walk")
elif dir.x < -0.5 and dir.y > 0.5:
change_animation("sw-walk")
elif dir.x < -0.5 and dir.y < -0.5:
change_animation("nw-walk")
func player():
pass
func change_animation(new_animation):
if current_animation != new_animation:
current_animation = new_animation
$AnimatedSprite2D.play(current_animation)
what this does, it ensures that the animations don't overlap and restart eachother as if u have multiple if's all of them will be ran in a sequence, when you use if && elif, only one will play at a time
well my first game that in my mind is something like survival but with a twist so this might be a huge help for me you gained a new subscriber ❤😊🎉 keep going man
wait are you the godot unicorn channel i have been looking for? subscribed
thank you so much!!! Glad I could help! if you ever need anything then please let me know!
Thanks!
thanks you so much!! Zahardnik your amazing brother! all love!
Thank you so much I searched so much for good godot tutorials but finally found it
I am so happy to hear that!! it is an honor to hear that!! it really means the world!! I hope the entire series is able to help you!! and if you have any questions please let me know!
@@dev-worm thank you I'll definately ask if I have any questions :D
This tutorial is really awesome, please continue to complete this tutorial, thank you
brooo, this tutorial is so helpful, thanks for doing this!!
Finally it out, looking forward for more videos ❤
you got a new subscriber my dude! 🙌
means the world brother!
I can't wait for the next episode ^^
tomorrow!
lets gooo i cant wait to make this
I had a question it will be great if u could answer this sir.
For the animation why not just listen on event such as left right up down click inputs, and then just Play the animation accordingly? That will be easy to read code.
Did I mention you are the hero we don't deserve!? anyways thanks for your videos!
thanks, i’m glad to help, if you need anything then please let me know
Man thanks for this tutorial, Im learning a lot from it, I also thank Godot for making it to where you dont have to manually enter the pixel height and width no more on the individual sprite sheets... once you set it once it follows the same everytime you open that file for animation frames. Really cool, Im excited to learn more about animation in Godot engine it seems very robust, I am also kinda wondering about easiest way to add animation embellishments to background elements such as random birds flying over head or maybe wind blown leaves occasionally... if you ever get the chance to showcase that in a tutorial I would love to see it implemented.
thank you so much! so happy to hear that! Ill look into the random background animations and see what I can come up with!
Great series!
I'll make one suggestion, try structuring your player movement a bit differently in regards to what sprite is called. Long if/elif blocks are kinda hard to read.
that is true and I completely agree with you on that!! thank you for reminding me, I shouldn't have done that.
@@dev-worm thanks for responding! Just getting into godot, so binging content while my new processor ships. I'm a couple videos in on this, and love it so far.
We're planning on making a 3d game, but your videos are great to learn how to navigate, and structure files.
Thanks again brother
Tired of entering the sprites row and column count over and over? Duplicate the "AnimatedSprite2D" as a child of the "AnimatiedSprite2D", add all your frames in the child node, and it will remember the rows and columns you entered. When done just move the child node under player and delete the parent AnimatiedSprite2D node...... Know idea why it's that way, but it makes the process so much faster for me.
I hope they add this soon as standard behaviour and also zoom with mouse-scroll while in the spriteFrame view.
Thank you for this !
of course anytime :)
Very helpful for newest developers like me!!!
looking forward to this woohoo.
Devworm i followed everything in your video up until 11:40 when you tested the movement but my chracter doesnt move i think it might be that godot isnt detecting my keyboard inputs do you know how i could fix this?
Replace "left", "right", "up", "down" with "ui_left", "ui_right", "ui_up", "ui_down" then use arrow keys
@@karlvincentescauriaga2525 ok i will try this
@@karlvincentescauriaga2525 it didnt work are there any other fixes you could suggest?
@@gamer20_man first add buttons
@@gamer20_open setting in input add your button
8k 🎉🎉
You almost near from 10 k
at 11:05 the code line that starts with "elif" has an error that says "Expected statement, found "elif" instead." and i don't know what to do now
Love the content so far. One word of advice that might help you type better and will make your videos more appealing and easier for old guys like me to follow is just to slow down a little. You move really fast through process which tells me you know what you are doing but it can take more time to continue backspacing so much when you are typing too fast. Take or leave it. I will be watching this full series. Thanks!
Hey devworm, I have a problem. The camera2d is not working. I set it as child of player, enable it as current camera and even tried to script one to follow player. Nothing is working
I hade problems with the idle state, so I needed to ad this
if direction.x == 0 and direction.y == 0:
if player_state != "idle":
player_state = "idle"
play_anim(direction)
previous_direction = direction
elif direction.x != 0 or direction.y != 0:
player_state = "walking"
Very, very nice! Well done!
thank you so much!! let me know if you need anything!
This is a great start but please slow down.. 😅
Having an issue with the idle animation. It's constantly going even after the code for the other directions is implemented. Any help?
today marks the day i’m learning how to create a survival game in godot. wish me luck
i wish you all the luck in the world!! if you ever need any help just let me know!! i want you make sure you finish this survival game!
It would be good if you add chapter in video 🙂
Thank you, I didn't know about sprite animation
Nice vid bro
When is the next episode coming
couple hours from now.. like 12 hours!
@@dev-worm ok bro, thanks
Thanks for your tutorials, I will be following it! I was wondering if you could make a tutorial to make custscenes and trigger events(like stardew valley) for Godot 4. I can't find this tutorial and I am a newbie
thanks dude, this is really nice
glad to hear that!
I got a idle animation where the sprite is turned to different direction how do I set it up so the sprite stays turn when the walking animation is over?
Спасибо, большое, очень полезно
i had an suggestion for maybe a future youtube tutorial project, it would be also very cool if you would make like an 3d but not really 3d game tutorial with godot. like for instance a 3d world but with 2d sprites. like paper marion or mario rpg
you rock bro keep it up!!!
Nice! but when comes the next video :p?
sorry next video comes tomorrow, and the rest of them will be uploaded every other day from then on out!
You are the best :)@@dev-worm
Awesome work 👏
Thank you so much!
Hey, sorry to bother you Sir. I am just wondering if I am able to use your tutorials for making a game and if I have to provide credit (Mandatory)? Thanks
no, you can open use all code
Please put all art in 1 zip file next time please. I'm lazy! :-)
After completing this tutorial, I almost gave up but I fixed my issue.
I changed player_state = "idle" to something else completely different because it was confusing and made me think it was attached to the (Idle animation) we made.
I noticed that the player_state = "IDLE" is useless because we would've needed the same amount of "if" statements we used to make the character walk but that wasn't shown in this video.
Anyways on to the next video!!
yes I shouldve put all the art in the same zip file, im sorry! And I agree with you on the 2nd part as well!
if i complete this game can u make it multiplayer?
Hi! i found your tutorial very helpful even for unexperienced games dev like me, but I have one question... so i made an idle animation for my character in every direction can you show us how to apply it in the Gdscript so whenever the player faces a different direction the idle animation changes? as example if i face east the east idle animation plays and so long... and thanks
I don't know if my code is wrong or something i did wrong but i need to mention that whenever i click the left, right, up, down button for movement my character animation doesn't play all the corner walking animations works but when i click all the buttons by holding it and stop and only holding left the animation of left plays but when i only click the left button the animation doesn't work it also doesn't work with all movement button right, up and down
So everything works great except when I stop moving, regardless of what direction I am facing, it always forces my character to look down. Any help?
How frequently will you be uploading this series?
at least 3 videos a week of the survival series.. so like every other day
isn't there an easier way to import the animations rather than entering the 20/8 over and over again , just wondering
anyway i appreciate your work thanx for the effort
Does no one make wandering enemies? Gyatdayumn
Let's see if it's worth the wait.
At the start of the video he shows the end product
not the end.. i’ll add more stuff most likely like a crafting system and other stuff that goes well with the game.. that’s just the basic prototype of it :)
Ok
@@dev-worm yeah, I know, i'll determine if it is worth the wait after the series is over.
Hi can you please do a tutorial on bone animation 2d
Shades puny pack is great. Would be cool to give him a big shout out
will do
Thank you!
of course, anytime! Thanks for watching!
Hey bro please make a tutorial on platformer player and coin shop in godot
Can you make a vedio on how to add plugins in godot 4 pls?
How did you make the spreadsheet for your art?
Good video, follow this super more ❤
Hey you should add a $ symbol so people can give you gratitude money. Some would prefer that over a subscription. Thanks for this video series. Exactly what I was looking for!
good point! thanks for the idea! glad i was able to help with the video, if you ever need anything then please let me know!
Been looking forward to this as an refugee from the engine that shall not be named. Will you be doing Melee combat in this as well??
i may also go over that towards the end, the prototype video you see here is just a prototype the finished product is going to have much more!
tried today with basic up-down-right-left animation only and with a sprite sheet of mine 32x32, i have done everything as in the video, i can correctly move the player in every direction BUT animations go mad, sometimems they work, sometimes only one stucks, etc..honestly i don't know what's wrong, maybe some of you can gime me some clues? (godot 4.2.1 win 64)
Hello, I wanted to tell you that at minute 12:11 everything I write gives me an error.
Sorry I solved the error😂
happy to hear you solved it!
i've been looking all over for a comprehensive tutorial like this one but i absolutely cannot stand video tutorials. i cannot learn from them in a way that matters. is there a pdf version with screenshots and comprehensive step-by-step text explanations?
not for this series! but im working on another series and trying to get it out this weekend! Ill make a pdf version of my tutorial and upload it somewhere to download
@@dev-worm duly noted!
i've been biting the bullet and following along step by step with you the last few days --
just so you know (you may wanna add a note somewhere in the descriptions or something): theres a bug in v4.2.1 that doesnt pull up variables of objects in the autocomplete. this bug has been fixed as of v4.2.2
i spent several hours trying to figure it out yesterday while following part 6 of this one. (i'd been brute forcing and trusting the process up until then)
dunno how relevant that's gonna be for you but its something i tripped on!
not sure if you can help on this, im a begginer learning as we go and for some reason my Camera2d wont work? no matter what i do it doesnt center the player or zoom in like yours does and i was making sure i did everything you do to make it work? im having abit of trouble? lol thankyou!
Same dude. Mine also doesnt work, i test it on other project and it works fine. Its driving me mad
@@Beeaannsss Yeah i am not sure why.. i have another project that im working on and its woking perfect, but on this one it just wont work... if there is anyone that can give us some advice it would be amazing!
@@SacredOrang OMG DUDE!! DID YOU PUT THE WORLD SCENE AS MAIN SCENE? THAT SOLVE THE ISSUE
@Peanut....... I am definitely going to give this ago!! Haha like 100%! I'll let you know if it fixes it for me!
@@Beeaannsss Youre a legend! this worked!! you need a medal hahaha, thankyou so much! this was driving me crazy!
I wonder if there is no other way for the 8-way animation? Do you really have to create each direction as an extra animation for each character individually?
And also for each attack, etc.? If you do this for 5 characters, for example, you have to make 80 individual animations. If you have even more attacks or movements, you are at several hundred individual animations.
Is that really the case with Godot, that it's such a hassle?
When I pressed control X everything got deleted, is there a way to fix this?