How To Create A 3D Endless Runner In Godot 4

Поделиться
HTML-код
  • Опубликовано: 2 ноя 2024

Комментарии • 67

  • @Extner4
    @Extner4 4 месяца назад +2

    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.

  • @ExploreGameDev
    @ExploreGameDev  Год назад +5

    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.

    • @shindig9000
      @shindig9000 Год назад

      I'm hoping in the future you or someone else will make a floating RigidBody3D raycast car controller like I've seen for videos in Unity.
      I can't figure out if I'm doing something wrong or if Godot physics are just not that good for it 😆
      Any kind of more advanced explanations of physic controls for one of the physics bodies would be extremely helpful.
      I want to understand the best way to make a car behave like a vehicle from the Twisted Metal games.

    • @ExploreGameDev
      @ExploreGameDev  Год назад +1

      @@shindig9000 I haven't used Unity very much, but I have heard from others that Godot (certainly v4), physics engine is pretty capable, but also you could very well be hitting a use-case that the engine just does not excel at. Godot did change the 3D node name from simply RidgidBody to the more specific RigidBody3D in version 4 so if you if you do a specific search for that ("RigidBody3D" in quotes), you should find more specific results to Godot 4 tutorials. Hopefully some that aid you on you quest. ruclips.net/user/results?search_query=godot+4+%22rigidbody3d%22 . Also, if you not yet tried, you could look into support from other aspects of the Godot community (Discord, etc) godotengine.org/community/.
      I'm currently working on a course on building a 3D game from scratch, but it is more Arcade style, not leveraging much of the physics engine, after that I'll focus more on the physics engine, as it's the natural progression of a more advanced capability in 3D games.

    • @shindig9000
      @shindig9000 Год назад

      @@ExploreGameDev thank you.
      Yeah, I've looked around a lot for that stuff and knew that since Unity wasn't that different that it shouldn't be too hard to transfer over but for some reason I'm just having a lack of understanding I suppose and can't get some specifics yet.
      That's great to hear what you are working on.
      What I want is definitely more of an arcade like feel, but it seems hard to find resources and videos on that for things outside of a normal character.
      But yeah, looking forward to it, especially if it just talks about interesting movement stuff that you can do with collisions or anything like that.

  • @JoltNet
    @JoltNet Год назад +6

    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!

    • @ExploreGameDev
      @ExploreGameDev  Год назад +1

      Hey Joseph, so glad you found it helpful. Yeah, I saw some of those tutorials and had some of the same thoughts. I liked how this turned out, I'm sure it can be improved but it is a good start.

  • @RarebitFiends
    @RarebitFiends Год назад +2

    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.

    • @ExploreGameDev
      @ExploreGameDev  Год назад +2

      thanks for the kind words, really glad you found the video useful

  • @temari2860
    @temari2860 Год назад +1

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

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      so kind of you to say, thanks, happy you enjoyed the channel

  • @brandonseasholtz3577
    @brandonseasholtz3577 Год назад

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

  • @trimoy5599
    @trimoy5599 Год назад +1

    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

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      That's great you were able to use it for 2d.

  • @MadManTnT
    @MadManTnT 11 месяцев назад

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

  • @VojtechLacina
    @VojtechLacina Год назад

    Thinking about trying this type of game, Thank You!

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      You're welcome!, have fun, and I hope this helps.

  • @dudemannxs
    @dudemannxs Год назад +1

    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!

  • @aivolution3295
    @aivolution3295 Год назад +2

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

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      Hey, thanks for the feedback. I’ve been trying to get my video times down closer to 10min, so I agree I rushed some of the code coverage. Next time I’ll further trim the scope of the topic I cover so the appropriate amount of time is spent with the code examples. Feel free to reach out if you have particular questions in regards to the code, I’m happy to give expanded explanations.

  • @AleksandarPopovic
    @AleksandarPopovic Год назад

    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...

    • @ExploreGameDev
      @ExploreGameDev  Год назад +2

      hey thanks, yes Godot4 can still be a bit tricky as final issues are worked out. Now that we are in release candidates, it shouldn't be long for the final release. 3.5 is great though, that will be relevant for quite a long time I'm sure.

  • @dongren1909
    @dongren1909 Год назад

    Thank you for your video.

  • @NAVANIMATION
    @NAVANIMATION Год назад

    Thank you :D

  • @dylancahill6522
    @dylancahill6522 11 месяцев назад

    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 👍

  • @Grampalamps
    @Grampalamps Год назад

    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?

    • @ExploreGameDev
      @ExploreGameDev  Год назад +1

      Thanks for the reply, my apologies, not sure I'd have the time to dig into that at the moment. You might try the Godot discord; discord.com/invite/zH7NUgz
      I've had good luck there in the past.

  • @Darkest-Kn1ght
    @Darkest-Kn1ght Год назад +1

    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?

    • @ExploreGameDev
      @ExploreGameDev  Год назад +1

      Great question, you can think of this tutorial as terrain generation in a single dimension, the z-axis in this case. I think you are proposing to extend this to generate terrain in the z and x axis. In theory, yes you could. The strategy in this tutorial works well for an arcade style game where there is no concern with matching the borders of any two given terrain tiles (nothing crosses that border or needs to align with something on the bordering tile). If you do need that feature or you want any sort of elevation to your terrain (which would need to be matched on bordering tiles), you might want to investigate true procedurally generated terrain. ruclips.net/user/results?search_query=godot+3d+procedurally+generated+terrain
      Let me know if this answers your question, and thanks for the feedback

    • @Darkest-Kn1ght
      @Darkest-Kn1ght Год назад

      @@ExploreGameDev Thank you for getting back to me. Yes, I would need to be able to match terrain tiles when they finish wrapping around. I saw a video by I believe his name is Sebastian Lague? where he actually took terrain data from shuttle missions, downloaded all the data, I believe he stitched all the tiles together, then turned a cube into a sphere, did some magic with the sphere, then linked all the terrain data to points of the sphere, thus, recreating Earth. He used Unity and C# though unfortunately. If that could be done in Godot 4, I'd be in hog Heaven!!

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      @@Darkest-Kn1ght yes @SebastianLague is amazing, I really enjoy his videos. For something similar to what Sebastian has done, you might look into heightmaps. I see a few promising videos.
      - ruclips.net/video/UPwoG_8KGa4/видео.html
      - ruclips.net/video/YiBrZMkCkLs/видео.html
      - ruclips.net/video/fEG_cnRQ1HI/видео.html
      If you start building something, be sure to share, would love to see it.

  • @GAllium14
    @GAllium14 9 месяцев назад

    NOICE 🎉🎉🎉

  • @dylancahill6522
    @dylancahill6522 11 месяцев назад

    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.

    • @ExploreGameDev
      @ExploreGameDev  11 месяцев назад +1

      Hey, sorry you are having trouble with this. I unfortunately am not at a point where I can dive in to troubleshooting; life is giving me other priorities at the moment :) . Have you tried running the code straight from a GitHub checkout, is it still giving you these issues. Best of luck troubleshooting, you might also try the Godot discord for general issues, I've found them helpful in the past.

    • @dylancahill6522
      @dylancahill6522 11 месяцев назад

      @@ExploreGameDev thank you

  • @RoBetoCarvajal
    @RoBetoCarvajal 8 месяцев назад

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

    • @ExploreGameDev
      @ExploreGameDev  8 месяцев назад

      Hello, The code for this demo is all here: github.com/exploregamedev/endless_terrain

    • @RoBetoCarvajal
      @RoBetoCarvajal 8 месяцев назад

      eh.. I mean, can you share the text that you paste into Godot? I don't understand nothing of GIThub@@ExploreGameDev

  • @jacobscott8277
    @jacobscott8277 Год назад

    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

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      Hey Jacob, sorry you ran into trouble. I just reseted with a fresh download and saw no errors. From your description, its getting tripped up where the code exhibits a "Typed Array". This lends me to believe it may be your version of Godot since the ability to type arrays came in as a part of GDscript 2 in Godot 4 [godotengine.org/article/gdscript-progress-report-feature-complete-40/]
      The game should run in any of the Betas of Godot 4, but you might take the opportunity to download the first release candidate of Godot 4 which came out yesterday. [godotengine.org/article/release-candidate-godot-4-0-rc-1/]
      Let me know if that resolves the situation, happy to look further if not.

  • @NightFoxZero
    @NightFoxZero Год назад +1

    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

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      hey, I appreciate the feedback on the video. It helps me to improve on future works.
      I attempted to reproduce the fall through the floor effect you saw. Since the Player and Floor have collision shapes that should not happen. In your instance are the collision layers and mask set to 1 for both the floor and the player?
      And true the players movement is not bounded in the x direction in this tutorial, I'll be sure to better callout those types of gaps (left out to help reduce the total video time) in future works.
      Regardless, I'm sorry you had issues with the tutorial, I know that can be frustrating.

    • @ThinkingNow
      @ThinkingNow Год назад +1

      The player script in the video doesn't apply any gravity, so the player capsule just hovers and doesn't fall toward the floor, so it doesn't matter that the floor doesn't have a collision shape yet. But the default code when you add a script to the player (at least in 4.0.2) does include gravity, so the capsule falls through the floor. One could just delete the gravity stuff from the default code if jumping won't be needed. Or since later in the video you do add collisions to the floor, it ends up working with gravity anyway.

    • @ExploreGameDev
      @ExploreGameDev  Год назад +1

      Thanks for taking the time to clarify that, much appreciated

  • @franklinclinton2274
    @franklinclinton2274 10 месяцев назад

    The terrain disappears when I export

    • @franklinclinton2274
      @franklinclinton2274 10 месяцев назад +1

      Update: Make sure to add an rstrip code before exporting in the func_load_terrain_scenes like this, scene_path = scene_path.rstrip(".remap")

  • @healbotstudios
    @healbotstudios Год назад +1

    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?

    • @ExploreGameDev
      @ExploreGameDev  Год назад +1

      hey, you're welcome for the tutorial.
      I just cloned a fresh copy of the repo and ran it and it succeeded without error.
      If you are using Godot 4 (I happen to be using RC1), you should not see that error as velocity is a built-in property of the CharacterBody3D node[1].
      If you are in a version of Godot previous to 4, that could explain the error.
      Check you version and let me know. If you are running 4 and still see the error, let me know and I can dig a bit deeper to try to reproduce the issue.
      [1]: docs.godotengine.org/en/latest/classes/class_characterbody3d.html#class-characterbody3d-property-velocity

    • @healbotstudios
      @healbotstudios Год назад +1

      @@ExploreGameDev Thanks for the quick reply. You are correct. The issue was an incorrect version. I was not using RC1 Godot 4, but an older version of Godot 4 from 2021 (Yikes!).
      Thanks for the quick debugging! All working now!

    • @ExploreGameDev
      @ExploreGameDev  Год назад +1

      @@healbotstudios thanks for checking that, I added a comment to the video description and my pinned comment. cheers

  • @juniorJGL436
    @juniorJGL436 Год назад

    As a video on how to export a game to apk in godot mobile

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      Hi, I've not done any mobile work to this point. Maybe in the future though

  • @MrZerosixZeroone
    @MrZerosixZeroone 8 месяцев назад

    If you want to have views start the video with the end result so people have motivation to watch it

    • @ExploreGameDev
      @ExploreGameDev  8 месяцев назад

      Thanks for the feedback, I think you make a good point, I'll consider that going fwd.

  • @EugenioTC
    @EugenioTC Год назад

    my character falls through the map

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      Hey, thanks for the feedback and sorry you're having issues. Someone above recently had that issue also (but we've not seen it prior to now). I attempted to reproduce the fall through the floor effect you saw. Since the Player and Floor have collision shapes that should not happen. Is the collision layers and mask set to 1 for both the floor and the player? Also which version of Godot are you using? I'll try to reproduce with the same version later this week.

  • @juniorJGL436
    @juniorJGL436 Год назад

    hello you do it from android

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      Sorry, haven't tried on Android. In theory you would just need to ensure the input map for the controls was set up for mobile touch.

  • @kirillmodlin8777
    @kirillmodlin8777 Год назад

    Too bad I can't give two likes!

    • @ExploreGameDev
      @ExploreGameDev  Год назад

      lol, leaving a comment is like giving two likes. The algo ♥'s comments!

  • @brandonseasholtz3577
    @brandonseasholtz3577 Год назад

    @ExploreGameDev need a lil help. changed the mesh to be the mesh desired for my game. and also changed the blocks and their respective collisionshapes out. but for some reason im getting an error at line 34 in the TerrainController saying invalid get index 'y' on base Nil. ive tried figuring it out alone, but dont really know what im suppose to be looking for exactly. its something with the block.mesh.size.y/2

    • @UCKY5
      @UCKY5 5 месяцев назад

      Did you end up figuring out the issue? I'm running into the same problem.

    • @keirasitare3211
      @keirasitare3211 4 месяца назад

      @@UCKY5samee