How To Create A 3D Endless Runner In Godot 4

preview_player
Показать описание
In this tutorial we will cover creating the terrain generation mechanism for a 3D Endless Runner in Godot 4 like you would see in a game such as Starfox.
The Terrain controller you create is a multi purpose one you can utilize in your own game.
At the end of this tutorial you will know how to craft a system that produces that terrain effect and be able to adapt it for a 3D game of your own.

❗Use Godot 4 beta 11 or newer for this project

❤️ Enjoyed this video? Subscribe to my channel and hit the notification bell to never miss a new video - and let me know what how-to's you'd like to see next in the comments!

-------------------------

Chapters ⌛
00:00 - Intro
00:33 - Diagram overview of terrain controller
01:32 - Build the world scene
02:01 - Add player stand in
04:10 - Building the first terrain block
06:56 - Add player controller script
08:22 - Duplicate the terrain blocks
11:26 - Create the terrain controller script
15:209 - Instance the terrain controller into the world scene
16:00 - Add end game state to player script
17:13 - Outro

-------------------------
Stay connected! 🔗

-------------------------
My current equipment set up. These are some great choices if you are looking.
-- Audio --
-- Video --
-- Display --
-- Input --

#godotengine #gamedev #indiedev #godot4
Рекомендации по теме
Комментарии
Автор

Tip to prevent selecting the mesh instead of the staticbody: when having the staticbody selected, you can press Ctrl+G or click the group nodes button in the top bar above the viewport. When nodes are in a group, clicking one of the children automatically selects the parent instead.

Extner
Автор

Hope you find this video helpful. Let me know about any questions or suggestions you may have. Thanks to @healbotstudios for helping to discover, it is recommended that you use Godot 4 Beta 11 or newer for this project.

ExploreGameDev
Автор

Finally! A tutorial that explains how to do a REAL infinite runner! Every other one I’ve seen has the player moving through space, and none of them point out the flaw in that approach: you’ll eventually run out of floating points and your game will break down. Thank you for this!

JoltNet
Автор

Thank you! This video was EXTREMELY helpful for me. I am an experienced developer, but newish to game dev and new to Godot. This helped with terrain of course, but I picked up A LOT about Godot and GDScript along the way too thanks to the explanation and code examples you provide. I am going to check out the rest of your videos too. Extremely helpful content, thank you again, subscribed.

RarebitFiends
Автор

Such a small channel with amazing video quality and extremely useful content. I've found a hidden gem, hope to see your channel succeed!

temari
Автор

thank you so much for this video, it is for 3d but i was able to adapt your code for an isometric runner in 2d

trimoy
Автор

omg. thank you so much for the help. been searching for a tutorial on an endless runner game for a while now.

brandonseasholtz
Автор

Great tutorial, kinda wish you went over the actual code in a little more detail. But that's probably just my slow brain 😂😂

aivolution
Автор

Great video. Thank you. If you can add more. We will all like it.

MadManTnT
Автор

I was working on this in Unity and was wondering how to port it to Godot. Thank you for this! And in Godot 4 too!

dudemannxs
Автор

Thinking about trying this type of game, Thank You!

VojtechLacina
Автор

Very nicely man, keep going, and good luck, but im still use Godot 3.5....i don't have anything bad for Godot 4, but I think there is still lots of work on it, and Vulcan like itself on it....but keep going, and good luck for your next projects...

AleksandarPopovic
Автор

This video was super helpful. One question though, if I wanted to add a terrain part with no obstacles at the start so the blocks don't just load instantly in front of the player, how would I go about doing that?

twest
Автор

Hi, so I got it mostly to work now. But when I collide with an object it cause the terrain to move forward everytime. For some reason the terrain_0 file is still in my world section, (the part with the player node). I don't know why. Maybe that's why the terrain keeps moving up.

Any help would be appreciated 👍

dylancahill
Автор

Excellent!
Where can I get that code that you put in?

RoBetoCarvajal
Автор

Hey, so I am having trouble with the programme. I followed the code, but when playing the game, the terrain keeps glitching forward cause thbrokayer to be outter bounds for a few seconds, there are three blocks that will not move, and the other blocks pass through them, sometimes the right key doesn't allow the player to go fully right, the 3static blocks will eventually go slowly forward and then suddenly go back.

Any help would be appreciated.

dylancahill
Автор

Just curious, could this method be altered slightly and used to build out a huge open world in which you could travel any direction? Ultimately, once the open world is fully complete, you could end up at the starting point?

Darkest-Knght
Автор

The movement script didn't work for me so I followed another tutorial for it. On the line var terrain_belt: Array[MeshInstance3D] = [] in the terrain generator, it says, Expected end of statement ("var"), got "[" instead. Ill see if I can work it out on my own but your help would be great Sir ExploreGameDev

jacobscott
Автор

Hey! Thanks for the tutorial. I am getting the error: velocity not declared in current scope, for the character controller.

I tried modifying the code to declare velocity as a var at the top (under SPEED) but then I get the error that .x is a Nil (null).

I also tried replicating the direction into a var velocity (same line of code), that got the game to load, but no movement.

Is there something I need to configure in the project settings in Godot for the controller to work?

healbotstudios
Автор

The tutorial is decent overall but using a plane as the floor didn't work for me. As soon as I added the movement script to the player I would just fall through the floor. Even when I tried putting a plane collider on the floor. Also since you didn't edit the script at all in the video you can technically move in any direction and there's no barriers to keep the player in. I wouold just call this a "Moving Terrain Tutorial" than an actual endless runner turorial

NightFoxZero