2D Platformer Quick Start Guide ~ Godot 4 GameDev Tutorial for Beginners
Тәжірибелік нұсқаулар және стиль
This quick start guide shows how to handle character movement, animations, tilemap setup, physics collisions, and smooth camera for sidescrolling pixel art games in Godot 4
Download Project ➣ ko-fi.com/post/Godot-4--Platf...
Also on Patreon ➣ / godot-4-quick-80723131
Art Pack ➣ anokolisa.itch.io/sidescrolle...
Platformer Tutorial Part 2 • State Machine Setup fo...
Platformer Tutorial Part 3 (Final) • 2D Platformer Attacks ...
➣ Downloadable Assets, Video Courses, and Other Places to Follow Me
linktr.ee/ChrisTutorials
ko-fi.com/christutorials
chris-tutorials.itch.io/
00:00 - What to Expect
00:29 - Create Godot 4 Project
01:29 - Interface Overview
01:52 - Importing Art
02:42 - New Level Scene
03:09 - Tileset Setup
04:21 - Tile Collision Physics
06:56 - Drawing Tiles on Tilemap
09:51 - Project Settings for Small Pixel Art
10:56 - Created a Player Scene
15:08 - CharacterBody2D Script Template
16:59 - Export Variables
19:02 - Lowering gravity
19:43 - Define Main Scene
20:34 - Setup Custom Keyboard Actions
22:45 - Double Jump Code
26:55 - Smooth Follow Camera2D
29:30 - Player Animations
33:50 - Animation Offset Fix
34:29 - Animation Switching Logic in Code
40:10 - Flipping Character Direction
41:47 - Switching to Jump Animations
44:46 - OnAnimationFinished Signal
45:48 - Stop Movement During Landing
47:32 - Jump Loop Animation
50:31 - Double Jump Animation
54:00 - Adjust Player Sprite Y-Offset
54:45 - Next Steps
Пікірлер: 270
People have been asking for more Godot 4 content. Give me a like if this is your thing and you want more of it. Cheers guys.
@KRETINStudio
Жыл бұрын
BIG LIKE!
@bryceforsythe8072
Жыл бұрын
Its how I found you channel and seems to be a much larger pull for viewers than your unity content. You have a nice pace and explain things well, but unity has reached market saturation for tutorials (at least in comparison to godot)
@ChrisTutorialsYT
Жыл бұрын
@@bryceforsythe8072 Yeah I'm definitely noticing that too. There's a lot more gaps in how to's for Godot but Unity is very mature software at this point (not that there's nothing new - The official aseprite to unity art importer package is pretty slick for instance)
@sweetgeorgiebrown6143
Жыл бұрын
liked and subscribed for more godot
@ironsalvo109
Жыл бұрын
those are really helpful! With godot 4 update some things changed and as a beginner it became harder to follow old tutorials
9:53 For anyone following this tutorial, you should NOT set the window scale to 4x. This will cause many more problems down the road including difficulties with UI scaling and positioning. Instead, on your scene camera, set the zoom to 4x. You will still get that zoomed in look for your camera while being able to accurately configure your UI and other objects.
@ornld
9 ай бұрын
You're a wizard, thanks for the tip!
@AhLottaAntwan
9 ай бұрын
how would i go about doing that? where is the zoom camera located?
@depepf3514
9 ай бұрын
@@AhLottaAntwan it'll be the Camera2D that you add to the scene (around 27:30 in the video)
@HippocritterXD
8 ай бұрын
Thanks for the tip 👍
@empty_abyss
8 ай бұрын
bro, you saved me, I was already getting mad because the character was walking so strangely
hey, thanks a lot for the support using my assets, hope it will be useful for everyone, I want to add new things to these assets, so that it has all the essentials for creating a complete game, so any feedback is very welcome as well as suggestions
@williammally4304
Жыл бұрын
If you are the true creator of the assets your comment needs to be favorited by the video uploader to give you credit.
@jayrent98
Жыл бұрын
i like the art style you have used in your assets. What program did you use to design them?
@cool_guy042
Жыл бұрын
dude the assets look great, keep up the great work :D
@mariafabiola4852
11 ай бұрын
hii, i study graphic design in Venezuela, we were learning the basics on how to animate a videogame and we used your assets too ❤ they're beautiful
@MR.cat_el_1st
10 ай бұрын
@@jayrent98 if your looking for a program there is one in your browser that good for pixel art its called losepc
there were some parts in the video where you messed up code, or said you were going to select/do one thing but one second later choose another (e.g. 31:50, start by saying jump all then do jump start) instead of leaving both takes in (an "incorrect" take that you redo later) i think it would be easier to follow if you cut that part out entirely. and then, you change your mind and put it jump_air in jump_start. for someone who likes to pause step by step, this can get a little annoying, and it would be best if you did a practice take, take notes for what you want done already, then do them so you don't get stumbled in your release video. but either way, glad you are making tutorials for godot 4! can get very confusing at times, with it being a new major release and all.
great, the best tutorial on this I've found. Moves along at a good pace covering lots while still easy to follow, much appreciated
Just what I needed!!! Thank you so much Chris! Super helpful stuff.
right now I was watching your Godot 3 tutorial of 2D platformer because I hadn't any other choice and It was the best I found but finally you made the Godot 4 tutorial I really needed
Very good Godot 4 teacher! Looking forward to seeing more videos!
Keep it coming! I've been holding back learning Godot to wait for tutorials for Godot 4.
This was a great and helpful tutorial for my first time using Godot! Thank you for making this!
I absolutely love you. You're seriously the best godot tutorial homie out there. Could you go over attacking as the player, and adding the enemies (especially the enemies attacking) and how to code the player getting hit? HONESTLY LITERALLY JUST ANY GODOT TUTORIAL YOU CAN PROVIDE I'D BE SO GRATEFUL FOR LOVE YOU MAN.
@ChrisTutorialsYT
Жыл бұрын
Yeah I'd like to do something like attacks and enemies next as a follow up to this video. Will have to see how time works out next week or two.
Clear and detailed. Thank you!
The best tutorial i have watched so far. Fast, simple and crystal clear with instant progress. Thank you very much, u earned like & subscribe :)
Love that you took comments and improved the code with changes!
Appreciate the tutorial - a lot of great info here...will definitely keep watching more of your Godot 4 content!! Many thanks 🤙
Thanks so much, bro. We have explined so much in just a little time. I loved!
Yo Chris YOU CANT UNDERSTAND HOW THANKFULL I AM THANK YOU!!!!!! just the right tutorial i needed litterley been 2 days searching and this tutorial is the right one!
Amazing! Took me about two hours to get through this entire tutorial with zero coding knowkedge. I was even able to adapt everything to different assets and figured out the changes along the way.
Thanks for the tutorial. Have played games for almost 40 years, worked in IT for 24 years, and finally making a start on making my own games. Some really useful tips in there that the Godot tutorial docs didn't include.
a big thanks for sharing this free, it save me a lot of effort and time to learn some stuff i didn't knew in godot
Thanks Man keep these tutorials going!!
So much useful stuff! This was amazing!
Very helpful. Thanks for your time making this
Incredibly useful ! Thank you very much !!
Really great tutorial, would love to see more of Godot 4 :D
Awesome tutorial. Thank you!
Awesome tutorial! I've learnt a lot!
Absolutely fantastic!
Amazing! Thank you so much!!
Really,Thanks you for the tutorial I hope you keep making these videos✌️
Thank you very much for this Quick Start! I feel I wasted so much time with Unity, and Godot seems to be the way to go now. There's still so much to learn for us beginners, though. I'm so used with javascript and C# stuff, like ending every instruction with a ";" and also the indentation being part of the syntax to the point it results in compilation errors. So much new stuff to tangle with. I'll be following you for more examples. Thanks, once again.
In case anyone is having trouble with the character not showing up in the scene when done editing collision mask, look at the player tab and see if it has a (*) next to it, he didn't mention it in the video, but you need to save it, I have windows so I hit Ctrl + s
@aras886
10 ай бұрын
Thank you so much
@boomboom6410
10 ай бұрын
THANK GOD!!! I was bouta self destruct before this!
@bobbyjones-uv5cn
8 ай бұрын
Thank you, almost freaked out lol
Thanks for doing these tutorials in Godot 4. Would also be very interested to see some advanced techniques for proceduraly generating levels or something like that.
Thank you so much!! Good wishes
amazing tutorial, thank you!
Big thank you.. I've been searching for issue related to camera 2d position smoothing. Your video explained it clearly.
Even though the tutorial is not perfect. I REALLY appreciate the fact Chris is doing all of this for free. Thank you, for this tutorial.
Such a great tutorial!!!
this was so helpful thanks a ton
very good tutorial!
Masterful, thanks a lot Chris, really appreciated. Much success to you brother.
NOBODY else has been able to teach me the camera smoothing trick! thanks so much! sharing with my subs.
Thank you chris!
Thanks a lot for this!!
Super video!
yes, now this video is relevant because of what unity has done
Very good tutorial.
Great tutorial, found it very helpful. The editing was a little choppy in some parts though, particularly in the Player Animations segment, where you'd say one thing, cut and rewind 10 seconds, and do something else. A little bit confusing to follow but otherwise everything was very well explained. One question: what's the purpose of getting the direction as a vector (including the Y component) if we're only interested in the X component? Is that to handle vertical movements later down the line, such as climbing ladders or something?
I had a fun little challenge, where I had to tweak the code a bit for the jumping animation, because I was using a different asset pack.
11:01 To create child node, instead of right clicking each time, just highlight the node you want to create child from and press the + below the Scene tab.
Great video. Thanks, Chris. Adding the section on the double jump confused me a bit in the later sections where you are chaining together animation logic. Had to rewatch a couple times but sorted it out.
vary good
thanks chris
thanks for the video
Thanks man that was really really helpful. I'm new to Godot & game dev. I chose godot because it's open source. Then I got into it, every tutorial i watched was in the previous version of godot.. so i got stuck. So thanks man
I want to make my own sprites and tile sets before working out programming, but this tutorial is excellent
Hi, Thanks for This video, there is a great way to add jumping and falling animation to the player with velocity.y value, if velocity.y 0 Then the character is falling.
thanks man
It's a great tutorial.
Bro keep going. Do not stop. Any new lesson. We get more understanding
What you can do is create: # checks if the obj/Node is on ground # if so, unlocks the flags (in_air & animation_locked) ~func is_on_ground(): ~ in_air = false ~ animation_locked = false This way, the animation stops at the same time the Player touches the ground TY for the tutorial, I was kinda MEH on learning Game Dev, it really helped me to continue this journey.
im so happy to see a tutorial in godot 4 stable version!!! will your older tutorials for godot 4 work even though some of them are before stable?
The find and replace shortcut for Mac is Cmd+Option+F
pretty nice tutorial, hope my will makes me use this as an inspiration for my own megaman x9 XD
So a couple comments. For the camera. You can attach a camera to the Player scene. Which will make it follow you automatically, and if you want smooth movement, so it's not just ON you all the time. You would enable "Position Smoothing" in the properties. Then change the speed to fit your style. Lower numbers mean the camera is less centered on the player while moving.
damn , the TileMap for Godot4 is
Super helpful. The only thing that bugged me was you switched your syntax in your conditionals when you started using parentheses in the _on_animated_sprite_2d_animation_finished function. Had my OCD going crazy
I honestly think this is a better method for coding the player animations for a small scale 2D platform than a Unity Style node animation state controller. I feel like you dont need that type of detail until you get to an open world RPG in 3D. This is less cumbersome and less prone to error by missing a checkbox somewhere. Great video
You are the fuckin GOAT my guy! Thank you for this!
u r the Godoat
who else is here after the entire unity debacle got interesting is game engines and now want to learn how to use godot
@jellifygirl
8 ай бұрын
Kinda? I'd already learnt unity for school, but couldn't do anything of my own because I don't have a PC so it was really dull... But when unity decided to explode its userbase and everyone was suddenly talking about Godot, I found out there's an android version that can do the same stuff as PC, and NEVER have I been more excited to learn a game engine (while using the worst control scheme imaginable)💥💥💥
26:03 extends CharacterBody2D @export var speed : float = 200.0 @export var jump_velocity : float = -150.0 @export var double_jump : float = -100 # Get the gravity from the project settings to be synced with RigidBody nodes. var gravity = ProjectSettings.get_setting("physics/2d/default_gravity") var has_double_jumped : bool = false func _physics_process(delta): # Add the gravity. if not is_on_floor(): velocity.y += gravity * delta else: has_double_jumped = false # Handle Jump. if Input.is_action_just_pressed("jump"): if is_on_floor(): #normal jump fro floor velocity.y = jump_velocity elif not has_double_jumped: #double_jump in air velocity.y = double_jump has_double_jumped = true # Get the input direction and handle the movement/deceleration. # As good practice, you should replace UI actions with custom gameplay actions. var direction = Input.get_axis("left","right") if direction: velocity.x = direction * speed else: velocity.x = move_toward(velocity.x, 0, speed) move_and_slide()
@ihaventthoughtofausernamey3398
6 ай бұрын
thanks
swear to god i did this the same in unity and i tryed to figuer it out months and didnt had any results but damn u did it bro thx man kinda understood need to do it more often godot feels better then unity
@enderremieenderman
Жыл бұрын
yeah and the tutorials are more beginner freindly then Unity
Note, if you click and drag something from the Hierarchy, to the script, and before letting go of the mouse button, you hold CTRL and then let go. It'll create the OnReady var for you.
Nice
thanks for the amazing tutorial. Do you know why the scene doesn't show after I change the window scale to 4?
48:27 you can loop it by copying (ctrl+c) then (ctrl+v) the frames in reverse, like CTRL C frame 5 , paste it, CTRL C frame 4, paste , and on, it went smooth for me :D
Hey friends, for anyone asking the question, "Why can't i draw any tiles?!" -chill. Make sure you have the cursor mode on select. No, not the one next to the paint and draw and other stuff. The one up at the top underneath the scene names (assuming you have the default orientation). Happy game making!
6:10 Going forward, do you mind using the Paint Property feature to optimize setting up Collisions Masks? It's the current Best prac in the 4.1 manual :)
Really helpful! Quick question is there any difference on changing the scale option on the window settings opposed to the camera zoom?
@ChrisTutorialsYT
Жыл бұрын
ha to be honest never touched the camera zoom. If you apply changes in the project settings though, that's going to apply everywhere across your game. If you change the zoom for one camera, that's only going to apply to that one camera - one level scene or definitely across a game will probably have multiple cameras. So you could of course change the zoom across different cameras (maybe switching to one for a close up shot or something). If you want the scale to change at a baseline, project settings is probably the place to do it.
awesome tutorial, godot made my life easier
I dont fully understand whats going on during 47:02 "stop movement during landing". But i am amazed at how you know how to fix and make it all work together.
Hey man, thanks for the tutorial! You managed to open up many little questions I had studying the documentation by myself. Reading is hard.
I'm only halfway through the video right now, so I apologise if this gets answered later, but is there a reason why you use an extra node to make the camera follow the player? Directly attaching the Camera2D node as a child to the CharacterBody2D seems to serve the same function, without the extra node in between.
U got subscribe ❤
Great tutorial .Please do attack animation tutorial .Its a request .Thanks 1 Performing an attack while jumping. 2 Executing an attack while running.
Great tutorial. By the way, are you recording inside a parking garage? lol so many car horn honks!
Really good! But you should speak at 0.75x speed!
I had many problems on the import assets step , the folders just disappear. I have re created the project 4 times, I will try doing 1 folder at a time. (It ended up I had to drag and drop the files, very glitchy only as far as importing assets goes.) It is a great project, now I am rolling, thank you!
even if i copy paste your code every time i hit the floor i get stuck unable to move left or right unless i jump and i can't double jump
followed exactly step by step. when character hits the ground it stays on the last frame of jump end doest go to idle or run. was something left out?
Each animation seems to have a different offset. It's hell to build that into the code and the offset only seems to work for the entire animatedSprite2D. I linked it to the facingdirection but there should be something more elegant
Have no game development experience buu I will try this later
Will this still work if i want to use 3D assets? Or would i need to make the game differently and just position the camera in a certain way to mimic 2D?
Love your tutorial! Just recently got into Godot and am having an issue with left and right not working. I've got everything identical as you, but for some reason, I cannot move left or right. I'm using 4.1.1 direction = Input.get_vector("left", "right", "up", "down") if direction.x != 0 && animated_sprite.animation != "jump_end": velocity.x = direction.x * speed else: velocity.x = move_toward(velocity.x, 0, speed)
@jamieadams4310
10 ай бұрын
It was working fine before changing it to a vector. Everything else works.
at 39:42 i get "Standalone lambdas cannot be accessed. Consider assigning it to a variable." error on line 45. how should i resolve this? ive followed everything exactly. did godot change their scripting? edit: solved it, make you indent things properly
At 5:35 I was trying to figure out where the Tile physics section and stuff was. Turns out it's been moved, now you have to right click the tilemap node and go in Sub-Resources to get to the tileset properties.
@3EP0
5 күн бұрын
It's no longer there, I cannot find anything. Whenever I want to learn blender, photoshop, any game dev engine or programing language the UI and functionality changes making all the older good guides useless, because the developers are complete morons who cannot stick to one design. (sorry for yapping)
its not letting me click the tiles to add phisics to them. Is using an already made texture pack a requirement?
Great tutorial, my only feedback is it starts nice and easy but the last 3rd is way way too fast, with all the animation logic. Hard to track what your thinking is and then new syntax is just dropped in like it's supposed to be known. Totally newbie here, so for sure I lack the knowledge but the pacing just goes a bit wild. I'll soldier on though, at the moment I'm just doing as you do without having any idea as to 'why' 😊
Who came here after that shiit Unity announcement??