Godot 4: Switching Levels Made Easy

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ธ.ค. 2024

ความคิดเห็น • 88

  • @PlugWorld
    @PlugWorld  ปีที่แล้ว +6

    If your interested in my upcoming course, you can check it out here! Thanks guys!
    courses.plug-world.com/seadefender/

  • @lucas_pscheidt
    @lucas_pscheidt 9 หลายเดือนก่อน +26

    ok wtf bro? I just entered this video just for no reason, and you literraly teached me what I need to learn to make a mechanic that I wanted in my first game for a game jam that I am participating alone, thanks so much, you explain so well! New sub

  • @neversyn2panda984
    @neversyn2panda984 3 หลายเดือนก่อน +5

    I really appreciate you going so slow, explaining what every part of the code is doing by both saying and showing. It may have made it slower, and people used to coding might find that annoying, but that’s the exact type of videos I’ve been looking for. I don’t have a clue what ANYTHING is doing, and it’s very hard to figure out when most videos spit out code and say “This works” without explaining why. Again, really really appreciate you taking the time to explain why everything is needed.

    • @Ranamo_
      @Ranamo_ 16 วันที่ผ่านมา

      So trueee!! They all act like we already know whats happening

  • @PorChorrr
    @PorChorrr ปีที่แล้ว +21

    You explain everything so clearly, subbed!

    • @PlugWorld
      @PlugWorld  ปีที่แล้ว +1

      Thanks! Glad it was helpful :)

  • @Fliximan
    @Fliximan ปีที่แล้ว +4

    I had been looking at so many tutorials, but this one was the only one that worked for me. Thank you so much!!!

  • @drbuni
    @drbuni 5 หลายเดือนก่อน

    Honestly, I tried implementing a level switch in so many ways suggested by other TH-camrs. Yours was the first one I was able to make it work properly, and I went one step further by moving the level switching logic to an autoload script (the level switch function is called by the player, when they touch the "portal"). The reason I did that was that I want to figure out later (hopefully) how to transfer the player data from one scene to the other (so the player character doesn't lose her power up).
    I also made a second function (and a second portal/gate scene) to take the player back to the previous level/scene.
    Learning programming is so damn hard for me, I find it difficult to understand, and I have zero confidence in myself, so thank you for making your tutorials so accessible.

  • @bryceguyle4799
    @bryceguyle4799 2 หลายเดือนก่อน

    This and previous video that led here were super helpful. To echo everyone else I really enjoyed how you were breaking things down and explaining why you made your choices.

  • @DarkMatter787-n2l
    @DarkMatter787-n2l 9 หลายเดือนก่อน +1

    If you close your eyes is like Mike Tyson is teaching you this Lol

    • @rmt3589
      @rmt3589 9 หลายเดือนก่อน +1

      From Beyblade or the Chef? I'm bad with names.

  • @davidphillips9366
    @davidphillips9366 ปีที่แล้ว +2

    Great to see you back!

    • @PlugWorld
      @PlugWorld  ปีที่แล้ว +1

      Thanks David! Glad to be back!

  • @ProgrammerPenguin
    @ProgrammerPenguin 6 หลายเดือนก่อน

    your level of energy is unmatched! keep it up, you earned a new subscriber.

  • @drordis2082
    @drordis2082 15 วันที่ผ่านมา

    wow! really really easy to follow, entertaining, and useful! lovely!

  • @Qilemonade
    @Qilemonade ปีที่แล้ว +3

    You’re a great teacher
    Would love more tutorials from you 😅

  • @MalteNielson
    @MalteNielson 7 หลายเดือนก่อน

    2 minutes in and I subscribed. Love the energy! I haven't even got to the part where you show what to do. Don't let me down now!

  • @cvrsor2985
    @cvrsor2985 11 หลายเดือนก่อน

    The energy you bring is incredible. One topic I think could use some more coverage on youtube is components.

  • @josiahkey
    @josiahkey หลายเดือนก่อน

    Far and above the best godot tutorial I have seen. Thank you, thank you, thank you for explaining the code and using print statements for proof of concept!

  • @lucamahncke2276
    @lucamahncke2276 10 หลายเดือนก่อน

    Loved this tutorial! Clear, simple, funny and the best: It worked!
    Thank you, would love to see more!

  • @SixGroundsStudios
    @SixGroundsStudios 3 หลายเดือนก่อน +1

    thank you so much this helped a lot

  • @valtris994
    @valtris994 7 หลายเดือนก่อน

    Thanks a ton for the tutorial! I like that you explain what things do as you go.

  • @ArabGameDev
    @ArabGameDev ปีที่แล้ว +2

    7:10 it's better to use physics layers than groups

    • @PlugWorld
      @PlugWorld  ปีที่แล้ว +2

      In my experience, physics layers are very helpful when dealing with physics objects. I use them whenever I want these objects to avoid collisions. Groups are great for simply identifying a specific object we are colliding with. But ultimately use whatever gets the job done for you.

    • @mrglick5050
      @mrglick5050 ปีที่แล้ว

      @ArabGameDev why?

    • @ArabGameDev
      @ArabGameDev ปีที่แล้ว

      @@mrglick5050
      th-cam.com/video/UZu8NwlkXcU/w-d-xo.html

    • @ninstars
      @ninstars ปีที่แล้ว +1

      ​@@mrglick5050 Using multiple physics layers for different things is not ideal for all cases because they have a set limit (up to 32 layers), it makes sense to use them if you are doing expensive physics operations for multiple physics bodies at the same time as they are faster to compare, but for cases like this is definitely worth using groups instead, it also makes refactoring less of a pain the larger your project gets.

    • @Ranamo_
      @Ranamo_ 4 หลายเดือนก่อน

      OMG THANK YOU SO MUCH I WAS STUCK FOR WEEKS AND TOTALLY FORGOT ABOUT PHYSICS LAYERS!!!!!!!!! MY GUY WAS ON LAYER 2))///)//!!!!! TYSMMM

  • @Mr_Boness
    @Mr_Boness 3 หลายเดือนก่อน

    How do you make your spinning cube remain looking like pixel art despite being rotated? Normally pixels would turn diagonal but your pixels look as if you have a sprite sheet for the entire rotation.

  • @Wayhoo
    @Wayhoo 11 หลายเดือนก่อน

    Love the energy! Thanks for the help!

  • @Evan0_
    @Evan0_ ปีที่แล้ว

    thank you SO MUCH! ive been stuck on changing the levels but this video worked!!

  • @draft_fusion
    @draft_fusion 8 หลายเดือนก่อน

    Dose not work on 3D scenes at all and still left confused

  • @kariimora
    @kariimora 5 หลายเดือนก่อน

    Keep it up man, this is good godsend content

  • @neverwinstudio
    @neverwinstudio 6 หลายเดือนก่อน

    hey can you tell me how i save my current level, when we go further so we need to save our current level so we come back so the level is save it start, a system for save and load

  • @brokenwings644
    @brokenwings644 หลายเดือนก่อน

    I understand what you said in this video bc these are what I already did. I came back to this video bc I want to know what if I'm missing something. And then I realize that, if it was me few months ago, when I had zero exp with code, I would probably skip all your chit chat and skip to the action part. But to be honest, your chit chat is really great for beginner, might help someone out of the tutorial hell like me. Thanks for the video btw, I watch all til the end (skill pressed for x2 speed lol)

  • @paulmanili2033
    @paulmanili2033 ปีที่แล้ว

    Good stuff. Thank you. How would you change it if there were cut scenes and level order may change based on difficulty level? For eample, difficulty 1 you do levels 1, 2, 3 but difficulty 2 you may do level 1, 3, 2, 4. And in betweem each level is a cut scene?

    • @kilisinovic
      @kilisinovic 6 หลายเดือนก่อน

      Instead of increasing number value have a list of numbers in order for each difficulty and then depending on difficulty search first for a number for index in list and then return next.
      easy: [1,2,3,4]
      normal:[2,4,3,1]
      level = 3
      list = easy
      if Globalstate.difficulty = "normal":
      list = normal
      index = list.getIndex(level)
      return normal[index+1]

  • @clide8414
    @clide8414 ปีที่แล้ว +1

    Hi! Cool video. What about save data (Example: int coins) between levels?

    • @PlugWorld
      @PlugWorld  ปีที่แล้ว +1

      If you want a variable to not get reset between scenes you can declare that variable in a singleton. Singletons are persistent across switching scenes. If you want to save and load data after the game is closed, there are several other guides for doing so. Hope this is helpful, good luck!

    • @clide8414
      @clide8414 ปีที่แล้ว

      @@PlugWorld Yeah, thanks, I get it. But how I can save data in a file? I am try save file in json, but...

    • @PlugWorld
      @PlugWorld  ปีที่แล้ว +1

      @@clide8414 I haven't done that yet in Godot 4, so sorry if it's changed. I usually go with the system that's documented here kidscancode.org/godot_recipes/3.x/basics/file_io/index.html

    • @clide8414
      @clide8414 ปีที่แล้ว +2

      @@PlugWorld thank u very well for support 💪.

  • @sniatch7256
    @sniatch7256 5 หลายเดือนก่อน

    Thank you! In the end it worked for me but I get some error messages which I don't understand yet. It still works tho haha

  • @Ranamo_
    @Ranamo_ 4 หลายเดือนก่อน

    Thank you for informative video. You helped me a ton!

  • @iconicprefix5522
    @iconicprefix5522 ปีที่แล้ว +4

    The way you hardcoded the path in your variable "next_level_path" 11:36 made the previous statement completely unnecessary where you dynamically determine the file path of the Top node.
    Additionally, There are projects where the level node is not the scene tree root (like a "Game" node), so entirely relying on that node for the file path isn't very maintainable, if you're planning to expand your project I wouldn't recommend it.
    Finally, some games don't have a linear level progression, so I would recommend exporting the scenes of the levels directly inside your portal or door node. This would be tedious, but it's a more robust, expandable, and maintainable system. Good tutorial though, good job 👍

    • @davidphillips9366
      @davidphillips9366 ปีที่แล้ว +3

      Every method has a use case, obviously this won't work for every single game but it doesn't have to. Its a very clever technique that will help people think outside of the box as they're learning to code and for a lot of small games it would work great.

    • @PlugWorld
      @PlugWorld  ปีที่แล้ว +4

      I totally overlooked that! Thanks for pointing that out! Yeah I could've had it dynamically parse the file path string instead of hard coding it. But that may of made it harder for beginners to follow along. Usually people will put all of their levels in one folder, so I don't think that hard coding it is really a problem. But I do see your point.
      I believe most people will have a system similar to this where the scene tree root is the level. More advanced systems such as random generation and dynamic level loading systems are much less common. People making these systems know what they're doing and probably don't need a level switching tutorial like this one.
      Totally agree with your third point. This system isn't for everyone. Those that need to go for more of a manual and configurable system will have to do something different. It's not possible to cover all use cases, but this is a great starting point.
      Thanks for the feedback, I really appreciate it. 👍

    • @rashy15
      @rashy15 ปีที่แล้ว +1

      bro really wrote an essay 😭

    • @iconicprefix5522
      @iconicprefix5522 ปีที่แล้ว +4

      @@PlugWorld I agree with your point in making tutorials easy for beginners to follow through. Having a solid foundation to expand on would also be great. I appreciate you for taking my feedback and being open with it.
      It's great to see people like you helping the community grow, I hope you continue making tutorials for beginners and intermediates alike.

    • @minyanism
      @minyanism 4 หลายเดือนก่อน

      ​@rashy15 Paragraphs 1 and 2 are only one sentence. Paragraph 3 is oly 3 sentences.
      Hardly an essay :(

  • @KoalaOnYT_
    @KoalaOnYT_ 7 หลายเดือนก่อน

    I've been able to turn this little platformer into a nifty little game
    Ive added
    killing the slime mario style (jumping on head)
    a little animation for picking up a coin
    i attempted coyote time but it didnt work well haha
    i have 2 main levels so far
    and a level switcher at the end of each level - which is the only thing i used another video for

  • @remingtonlewis2000
    @remingtonlewis2000 3 หลายเดือนก่อน

    tnx bro. super easy to follow and understand!

    • @alexanderbui5735
      @alexanderbui5735 3 หลายเดือนก่อน

      Does it matter if it is in scene or global groups when i create it on the player? I am using godot 4.3 and have a character2d... and it doesn't work. Help @plugworld

  • @GabbyMcAuley
    @GabbyMcAuley 7 หลายเดือนก่อน

    Bro thank you so much this really helped with my game.

  • @lonewolfprogrammer8932
    @lonewolfprogrammer8932 7 หลายเดือนก่อน

    FUUUUUUUUUU!! I had a root node above level 1, so current_scene_file would not be the path to level 1, I couldn't figure out how to remove the root node other than removing the entire tree and dragging level 1 tscn back to the window... that broke my entire game and undo button did nothing, can't even load my game now, awesome :(

  • @IroquoisPliskin86
    @IroquoisPliskin86 8 หลายเดือนก่อน

    How much coke did you do before this? What it all of the coke?

  • @ElGamerDesafortunado
    @ElGamerDesafortunado 2 หลายเดือนก่อน

    This video is super well explained, however the pipeline I'm using has numbers on the folders, so RIP me

  • @fuwa9899
    @fuwa9899 10 หลายเดือนก่อน

    You a real plug fr

  • @pietraderdetective8953
    @pietraderdetective8953 ปีที่แล้ว

    More Godot 4 videos please!
    Great content!

  • @nemila4904
    @nemila4904 4 หลายเดือนก่อน

    I like the way you explain, It keeps me focused for some reason 😂 thx 👍

  • @chongthechihuahua2643
    @chongthechihuahua2643 ปีที่แล้ว

    Does this work for 3d games?

  • @fatmike5038
    @fatmike5038 ปีที่แล้ว

    wait till you start to discover thing like singulars and arrays.

  • @tekkerzdesigner5435
    @tekkerzdesigner5435 6 หลายเดือนก่อน

    BEST TUTORIAL EVER

  • @alikease11
    @alikease11 7 หลายเดือนก่อน

    thank you this helped me a lot :)

  • @podgeftbl
    @podgeftbl ปีที่แล้ว

    so helpful, easily earned my like

  • @ravendaee
    @ravendaee 11 หลายเดือนก่อน

    Thank you so much for this video

  • @lukynko
    @lukynko 9 หลายเดือนก่อน

    BIG THANKS, YOU SAVED ME

  • @mynameis950
    @mynameis950 7 หลายเดือนก่อน

    This is not a good solution.. If I have 30 levels and decide to insert a new level before level 2, I would have to rename 28 other level files. I recommend creating a singleton where you have 2 variables: an array of the level files and the current level index. When you load a new level, increase the level index and load the file at that index of the level array.

  • @S1lence46-p4h
    @S1lence46-p4h 4 หลายเดือนก่อน

    It doesnt work for me and my character is a physics thing

    • @Ranamo_
      @Ranamo_ 4 หลายเดือนก่อน

      Me too

  • @boanediggadukabberst5380
    @boanediggadukabberst5380 8 หลายเดือนก่อน

    You explain it very well thank you for Help please more of good Godot Tutorials👍

  • @RandomManFromPoland
    @RandomManFromPoland 7 หลายเดือนก่อน

    Great tutorial

  • @ViViViVuVuVu
    @ViViViVuVuVu 5 หลายเดือนก่อน

    goated tut

  • @RequstingFlyby
    @RequstingFlyby 3 หลายเดือนก่อน

    I thought this was the standard logic / path for launching / entering new levels? Maybe I’m just built different… #GFC

  • @blasterxt9
    @blasterxt9 10 หลายเดือนก่อน

    Good job buddy

  • @-smile-1
    @-smile-1 ปีที่แล้ว +18

    pls go quicker next time 😅

    • @parkerpierce8931
      @parkerpierce8931 6 หลายเดือนก่อน +1

      Don't

    • @sugarette_burn
      @sugarette_burn 3 หลายเดือนก่อน

      Use 1.5x, it's on the TH-cam options

  • @RodrigoMendes-bd3bp
    @RodrigoMendes-bd3bp 11 หลายเดือนก่อน

    Thanks !

  • @pipeliner8969
    @pipeliner8969 5 หลายเดือนก่อน

    please make more videos

  • @Lowwaels
    @Lowwaels 5 หลายเดือนก่อน

    thanks

  • @JagArFlicka
    @JagArFlicka 11 หลายเดือนก่อน

    womp, thank you:3

  • @ravagerboss8335
    @ravagerboss8335 หลายเดือนก่อน

    it is very nice

  • @UsernameaBad
    @UsernameaBad 6 หลายเดือนก่อน

    Bro spent 10 mins explaining 3 lines of code

  • @kardrasa
    @kardrasa 11 หลายเดือนก่อน

    Anderson got a YT channel? Lets g0000! I sub