How to make a 3D platformer in Godot 4
Ғылым және технология
This tutorial uses Godot 4 Beta 8.
Link to Mario: sketchfab.com/3d-models/mario...
Link to animation tutorial: • Godot 4 - Make your ow...
- you can follow this Mixamo tutorial but you won't have to make the library but just import it straight into Godot
Follow me:
Twitch: / aj08coderwastaken
Twitter: / aj08coder
Itch.io: aj08coder.itch.io/
GitHub: github.com/AJ08Coder
Discord Server: / discord
I like to make games and do game jams so go check out some of them at my itch.io! I used to do unity but then I decided to hate unity and go to Godot! Hopefully, you enjoy my content, and if you want to give me feedback on my videos, comment below!
Thanks to game endeavor, poly mars, and Dani for inspiring me, I used to do unity but I switched to the Godot game engine. GD script 4, Godot 4, four
Пікірлер: 108
Bro teached me more in 6 minutes than I could learn in a 40 minute tutorial 👍
Wow, I did not realize that Godot gives you a starter script for character controllers. That is really awesome actually.
@0127MAKEITRAINMCRITISISM_
9 ай бұрын
i didn't get it
@JustBasicAnimator
9 ай бұрын
it means it gives you free code that makes your basic movement@@0127MAKEITRAINMCRITISISM_
@darthtechnologies553
8 ай бұрын
Its open source, of course it would 😂
@madlink3495
5 ай бұрын
@@0127MAKEITRAINMCRITISISM_ when attaching the script for the node CharacterBody3D godot gives you the option to use the default script that contains the code the video didn't have to add.
Thank you for zooming in on important portions when needed!
amazing tutorial, straight to the point, works fine, love it
thanks man, this is a great tutorial!
Love how straight to the point this is- would love more 3D game tutorials by you (adding enemies, moving platforms, different movement mechanics- whatever comes to mind)
@vpsip123
7 ай бұрын
Ok as i followed step by step i went to move the character into the world scene i noticed i didnt have a player.tscn like you did- so i was unable to keep going… but overall still like that the tutorial helped me get my hands on godot quicker, just wish some stuff had notes on screen or something
@vpsip123
7 ай бұрын
Wait im silly i just needed to save the player scene (keeping these rambling comments up for anyone else going thru the same things)
tysm keep it up man !! fast and easy to understand !
THX for updated version of Miziziziz video: "How to make a 3D platformer in Godot in 8 minutes". Apretiate Your work Friend!
First Godot tutorial I found that wasn't outdated. Thanks so much!
Is there a part 2? How to add more levels, enemies etc.
Spent 2 days on that Kinematic Body change to 3DCharacter, the Blender to Godot animations rock though. Also finding more info right in the editor👌
@darthtechnologies553
8 ай бұрын
Are you using a library or something you self rolled??
That was a great starting point, no arsing about, straight into the video and not too full of waffle,
C# code for anyone who's decided to start with c# - the quirks are that you can't access .x and .y directly of vectors (and .z), rather you need to make a temp variable and make the changes there, then reassign. There's also a few other quirks using Godot; using System; public partial class PlayerController : CharacterBody3D { public const float Speed = 5.0f; public const float JumpVelocity = 4.5f; Node3D CameraBase = null; float CAMERA_SENSITIVITY = 1.0f; // Get the gravity from the project settings to be synced with RigidBody nodes. public float gravity = ProjectSettings.GetSetting("physics/3d/default_gravity").AsSingle(); public override void _Ready() { Input.MouseMode = Input.MouseModeEnum.Captured; CameraBase = GetNode("CameraBase"); } public override void _UnhandledInput(InputEvent @event) { if (@event is InputEventMouseMotion MouseMotion) { Vector3 CameraRotation = CameraBase.Rotation; CameraRotation.X -= Mathf.DegToRad(MouseMotion.Relative.Y) * CAMERA_SENSITIVITY; CameraRotation.X = Mathf.Clamp(CameraRotation.X, Mathf.DegToRad(-90), Mathf.DegToRad(90)); Vector3 CharacterRotation = Rotation; CharacterRotation.Y -= Mathf.DegToRad(MouseMotion.Relative.X) * CAMERA_SENSITIVITY; CameraBase.Rotation = CameraRotation; Rotation = CharacterRotation; } } public override void _PhysicsProcess(double delta) { Vector3 velocity = Velocity; // Add the gravity. if (!IsOnFloor()) velocity.Y -= gravity * (float)delta; // Handle Jump. if (Input.IsActionJustPressed("Jump") && IsOnFloor()) velocity.Y = JumpVelocity; // Get the input direction and handle the movement/deceleration. // As good practice, you should replace UI actions with custom gameplay actions. Vector2 inputDir = Input.GetVector("Left", "Right", "Forward", "Backward"); Vector3 direction = (Transform.Basis * new Vector3(inputDir.X, 0, inputDir.Y)).Normalized(); if (direction != Vector3.Zero) { velocity.X = direction.X * Speed; velocity.Z = direction.Z * Speed; } else { velocity.X = Mathf.MoveToward(Velocity.X, 0, Speed); velocity.Z = Mathf.MoveToward(Velocity.Z, 0, Speed); } Velocity = velocity; MoveAndSlide(); } }
@JustBasicAnimator
9 ай бұрын
thx
thank you and keep going bro
How would I go about adding a landing animation?
awesome🔥🔥
where did you got the player from???
Great stuff. Would you consider doing a complete platformer with enemies, environment, physics or puzzles out of this?
@aj08coder
Жыл бұрын
Right now I'm working on other projects but maybe I will try that. Thanks for the suggestion
@Wonkabonka
Жыл бұрын
There's a guy who made a tutorial for how to do buttons i think. You can use the same logic to make puzzles easily. Good luck!
great tutorial
@aj08coder
Ай бұрын
Thanks!
0:24 at this jump cut you added a camera and a tscn file. I understand how to get the camera but how did you add the tscn file?
@aj08coder
Жыл бұрын
I saved the scene and named it player
Cool! Thank you
how do i get the code on these other lines at 3:41?
Gr8 bro 🎉🎉🎉❤
Very good video, congratulations! I'm starting to learn godot, but is it still worth it for me to learn godot in version 3.5 or should I wait for version 4.0 to come out? does it change much? Can you give me any tips on how to learn and use GDScripts in a simple way to use them in the creation of games on godot, because I don't have that knowledge and congratulations for the video.
@aj08coder
Жыл бұрын
Starting to learn Godot 3.5 is a good choice if you're eager to start making games and don't want to wait for version 4.0, which is still in development. GDScript will change in Godot 4 but not that much to wait for Godot 4 so you might as well start now. To learn GDScript, I recommend going through the Godot documentation, exploring sample projects, and watching tutorials on what you specifically want to do with your engine. Good luck with your learning journey!
@franquealencar
Жыл бұрын
@@aj08coder Thank you so much man, for your words, for your opinion and your tips, this video was amazing and I really want to learn something similar to what you did, creating the character controls. Thanks and success on the youtube channel and in your life!
Dude I did everything u did but when I try running it it says “characterbody3d cannot be attached to node3d”
The ninjas are coming
why do I keep getting a node configure warning for static body 3d telling me to change the size in the child nodes, but when I do, the player simply falls through?
@tylershanegriffin5302
Жыл бұрын
I had the same problem but I set the staticbody's scale to 1,1,1 and then changed the child size to update the parent.
Im doing everything you are doing but the camera just doesn't work, its not giving any errors and it runs just fine but its just that the mouse and the camera dont work
The files in the download link are completely different from what is shown on screen. 😅 I tried those files anyways but there was no animation player in the list. And after adding in one there doesn't seem to be any animations at all. So can't do this tutorial past the 'New Inherited Scene' step. That is where it all just hits the wall. 😑
@WeirdWimp
4 күн бұрын
Just do the ones on screen
for some reason when i move my mouse it tilts the screen? can someone help
don't know if it's because of changes to Godot, but when I add the camerabase it does not rotate around the character that way his does in the video, it just rotates the camera normally.
@jikkermanccini
Жыл бұрын
You're lucky, even with a 1:1 replica of the video code, the camera he wrote just won't work for me.
@Wonkabonka
Жыл бұрын
A cool camera you can make is the kidscancode chase camera. But remember to have the camera in the scene not the player. And nodepath means clicking on the camera, looking at the bar on the right and click nodepath, set it to the player
@WeirdWimp
4 күн бұрын
It works for me and I use latest version
hey um i having some issues. And the issue is when i tilt my camera up or down it starts glitching out crazy and my up and down is inverted
@WeirdWimp
4 күн бұрын
I had the problem too, switch the x and y axis, I remember there was one part you shouldn’t switch but I forgot
thanks a lot
for some reason while animating, i keep getting an error “attempt to call function ‘play’ in base ‘null instance’
@goutamdas6737
3 ай бұрын
I got the same error
How to jumping on moving platforms?
You helped me to make my dreams become true!!
im getting an error at 3:40 it says that the "if" part needs to have a : after it but when i add it everything else breaks
@WeirdWimp
4 күн бұрын
Not just after the if like “if: Input.blablah(stuff)” instead after the whole line like “if Input.blablah(stuff):”
Pls I need help😢 on the line that says rotation.y -= and so on it is showing me an error and it says Expecting closing “)” after call argument any help with this but over all this was a great video and helped a lot
@aj08coder
Жыл бұрын
it seems like there might be a syntax error in your code. Without seeing the code, it's hard for me to see the exact issue, but make sure you have closed all parentheses properly or not accidentally added a '(' without closing it
I'm getting this error: E 0:01:27:0401 get_node_or_null: Can't use get_node() with absolute paths from outside the active scene tree. Condition "!data.inside_tree && p_path.is_absolute()" is true. Returning: nullptr scene/main/node.cpp:1272 @ get_node_or_null() When I try to run the program to test. I'm at the stage before lighting is added, so the first test. I'm pretty sure I've copies everything to a T.
pls tell how to make a uniform scale
awesome video but how do i add respawning and stuff so if the player falls off the platform he respawns
@WeirdWimp
4 күн бұрын
Have an area 3d under your world that sends you back to your worlds scene when you touch it
The shape doesn’t spawn for me but I did everything you did
I understood everything except for deg to rad what is that?
bro hit puberty
literally best so fast but i wish you'd explain the mouse code
When i finished this and i tired it i fell right through the floor, but i continued anyway but still i fall through the floor how to fix
@aj08coder
8 ай бұрын
Make sure your player and floor had collisions and make sure the floor is a static body
@-smile-1
8 ай бұрын
@@aj08coder yep,yep i figured that out yesterday only tyysmmm thoo! Also how do i make levels? And after following this tut i made the camera in front of the player so it would be firdt person and i downloaded dungeons parts (asset) frim the asset lib, but u walk right through them, i know i have to add collisions but to add it to each single asset is toooo much is there a way it can happen automatically?
@-smile-1
8 ай бұрын
@@aj08coder also tysm ur 6 min tutorial was wayy better than watch this other 40 minute tutorial as urs was faster and worked wayy better, also i cant move my player with wasd only arrow keys idk why i made those things W A S D move_front ect. Ect. But maybe something in my code can u help fix?
mine is having a error
The jump animation doesn’t work
speedrun?
dam bro. u should make more tutorial . other tutorial so fast and so long for beginner . i keep thinking on how to add the scene into the node. and you just drag and drop into the node.
How do i exit from the scene with no mouse:( Cool tutorial btw
@WhyIsSveenyTaken
4 ай бұрын
Just press the windows button and hover over the godot editor
Thats not working when im trying to run current scene it giving me error called script inherits from native type characterbody3d bla bla it cant be assigned to object of type node3d
@WeirdWimp
4 күн бұрын
You have to right click the node 3d the inherited scene starts from, change type, and change it to character body 3d. That should work.
Sorry bot the camera did not work it just stais as it is
when i test the game the player falls down why ?
@Arcadoe
9 ай бұрын
Did you use a collisionshape3d node?
i do wish you would slow down
FOR THE LOVE ALL THAT IS HOLY PLEASE SLOW DOWN. Pretty good tutorial other wise 9/10. {:
Will it work in godot3?
Would be nice if this movement wasn't constrained to have the camera right behind the player and could instead have the player move independant of the camera.
@aj08coder
Жыл бұрын
Yeah I might try that
@generrosity
Жыл бұрын
I imagine it's "as easy" as changing the part where you mention the mouse rotates the whole model, and just apply to the camera arm instead? Then think about how games have a delay before returning the camera, etc 😊😵💫
@tafarachikumira3717
9 ай бұрын
@@generrosity😂😊😮😮😢❤😢
how to get collision and mesh instance at 0:13 youare too fast
@potatoman7037
Жыл бұрын
I wondered the same
you go way too fast you need to slow down your tutorial
@MH-dn3jz
Жыл бұрын
Yup. Agree.
@darthtechnologies553
8 ай бұрын
There is a speed setting on youtube if you cant keep up.
AAAAAHHHHHHH IT WONT LET ME SCALE THE LEVEL IT JUST MAKES IT ALL THE SAME
Camera is very janky.
Thanks, the code instantly crashes everything forever. Doesn't work. Broken.
@WeirdWimp
4 күн бұрын
It should work, you have to do everything exactly as they did jot it to work. The file won’t open if there’s even one error.
I want see your script, in one moment your script exchanged, lol
please make a tutorial series about making a Garten of Banban game :) pleaseee!! I can give you some skins and animations :P if you need them.. I want to learn that!!!
Dont recommend this tutorial for beginners. You have to have some knowledge about godot before
Chafa
i cant drag the player into the world, player.tscn isnt there more me EDIT: i found out all i had to do was save lol EDIT 30 MINUTES LATER: game wont work idk