How to CHANGE SCENES in Godot | ARPG S02E02 | tutorial | GDScript

Sdílet
Vložit
  • čas přidán 11. 09. 2024

Komentáře • 147

  • @Normit08
    @Normit08 Před 5 měsíci +36

    I agree with you that that you shouldn't just skip ahead to the final result. It's good to show things like mistakes or code that evolves and needs to change. A lot of tutorials don't go into the thought process enough to teach beginners fundamental programming skills like problem solving. If you just going to show someone how to code / make a feature and they don't know why they doing it then they not going to be able to transfer that skill into other things they do. All they will learn is how to make a feature in a very specific way.

    • @MakerTech
      @MakerTech  Před 5 měsíci +4

      Thank you so much for the comment.
      It really means a lot.
      My goal really is to try and teach good software engineering principles with hands-on examples of what real life development is like.

    • @briancollins2248
      @briancollins2248 Před měsícem +1

      Absolutely agree, please continue with your approach. It is super helpful to show the iterations to get to the final solution and as you said teaches good software engineering principles. Skipping ahead with shortcuts skips the fundamental knowledge that is earned while working through the iterations.

  • @MCNeko6554
    @MCNeko6554 Před 5 měsíci +20

    Anyone struggling with Player part: make sure your player script has a class name. For example, my player. gd script starts with "class_name Player extends CharacterBody2D" on the first line (minus quotes).
    AHH you have no idea how much I struggled to figure out why the scene transitioned immediately upon beginning play whether I was using a simple area2D or an autoloaded area2D with signals. Thank you once again for your tutorials, wish I had just started here earlier...

    • @MakerTech
      @MakerTech  Před 4 měsíci +1

      I'm glad you liked the vidoe and found it helpful :)

    • @tomoyaokazaki2138
      @tomoyaokazaki2138 Před 4 měsíci +1

      thank you so much! I was wondering how to fix that. the scene_manager script giving me the error that it could not locate the name Player. giving that class_name to my player script fixed it immediately! btw, I'm using Godot 4.2

    • @lorein_4368
      @lorein_4368 Před 2 měsíci

      Thanks!

    • @CLIBasedNerd
      @CLIBasedNerd Před měsícem

      THANK YOU SO MUCH

    • @opaqueprism9250
      @opaqueprism9250 Před 13 dny

      OMG thanks so much!

  • @hexaldecima6839
    @hexaldecima6839 Před 5 měsíci +9

    I'm saying it again---You're one of the best, if the not the best, Godot teachers/tutors on the web.
    I still can't believe these videos are free to see. Thank you for that.

    • @MakerTech
      @MakerTech  Před 5 měsíci +2

      Thank you so much for the feedback.
      It really means so much to me :)
      I am really trying to keep everything free as long as possible.

  • @allstarspixel
    @allstarspixel Před 2 měsíci +4

    I think this video taught me more than just scene changing. Before I wasn't sure how to go about not making a new script for every room I wanted to go to, but now, I know the method of changing it in the inspector which is really useful for multiple nodes. Thank you so much.

  • @RobertoGongora
    @RobertoGongora Před 6 měsíci +4

    Thank you for this, I was just struggling on how to design/implement a scene transition manager and your video filled that knowledge gap perfectly. It's very easy to follow and to iterate upon, and the way you narrate the script is very straightforwar and to the point. Keep up the great work and thank you for everything you do.

    • @MakerTech
      @MakerTech  Před 6 měsíci

      I'm so glad you could use the video.
      I was a bit worried it was getting too long.
      But at the same time I didn't feel like I could leave anything out or divide it into smaller pieces.

  • @teahands
    @teahands Před 5 měsíci +9

    Great video, thank you! I wouldn't worry too much about people being too impatient for these longer ones, as you said the iteration is part of the process, and learning to take that step back and look at the wider changes you need to make is a crucial skill to learn. I'd go so far as to say NOT learning how to do that is why so many people get stuck just copy pasting from tutorials and not being able to go any further, so you're doing us all a big favour with this format!

    • @MakerTech
      @MakerTech  Před 5 měsíci +2

      Thank you for the feedback, it means a lot :)
      I'm not really to worried about it.
      I just try to make a huge point out of why we do it this way.
      Because it really is so important to understand if you want to really learn any kind of software development.

  • @maedemeier
    @maedemeier Před měsícem +2

    It finally works! After many error messages and a new attempt. I am so happy. Thank you so much for your videos. 😊

    • @MakerTech
      @MakerTech  Před měsícem +1

      Yay!
      Congrats with sticking with it and getting it to work :)

    • @maedemeier
      @maedemeier Před měsícem

      @@MakerTech Thanks. 😊 I think one of the main reasons for the error messages was that I gave my player a special name.
      Now I just have to figure out how to change the hearts, inventory, etc. as well. 😉

  • @CosmicEmber
    @CosmicEmber Před měsícem +3

    I had an issue with the character changing to the correct position in the house, but upon returning to the previous scene it would put me somewhere else than the set entrance marker. Thankfully I figured it out but saw that other people had the same issue with seemingly no comments pointing this out so I hope this helps anyone struggling with the world entrance marker!
    at around 24:26 the 20th line in the base_scene script is
    if entrance is Marker2D and entrance.name == "any":
    but later at around 27:05 the same code (now the 26th line) is updated to be
    if entrance is Marker2D and entrance_name == "any" or entrance_name == last_scene:
    So the problem was I kept it as "entrance.name" but it should be "entrance_name".
    The early code works when the entrance marker is named "any" but if it's named after the previous scene ("inside_house" in this case) it gets ignored. I tested it and deleting the entrance marker in the world scene put me in the same place as it did before changing the entrance.name to entrance_name
    basically: the TLDR if you have this issue, check to make sure this line uses "entrance_name" instead of "entrance.name" in the base_scene script (I'm not the best at explaining stuff so I'm very sorry if this is hard to understand)
    I do want to add thank you Maker Tech much for this series, I've been wanting to learn Godot for a bit and your tutorials have really been helping me with learning how to use the program and its scripting!

  • @itsthekomar
    @itsthekomar Před 6 měsíci +6

    @Maker Tech maybe you could make a video on how to make settings/options menu - video - resolution window options, audio, rebinding controls and more? You could make tutorial on how to make main menu and menu for loading saves of game.

    • @MakerTech
      @MakerTech  Před 6 měsíci +3

      Hi, and thank you for your input.
      I think I have most of your ideas on my (long) list of video ideas from viewers already.
      You can always see what I'm working on for the channel at my public Trello board: trello.com/b/kbbA5lIf/maker-tech-public

  • @cleanwithemma7826
    @cleanwithemma7826 Před 3 měsíci +2

    Hello.
    I just want to say that as a newcomer to Godot, your way of showing and telling is absolutely perfect. You should have been a teacher :) Take it as a compliment :-)
    I have been following your videos now to make a simple game with my two daughters and I am wondering about one thing. Instead of going through the door, is it possible to get [E] up to open the door? And animate the door too :-)

    • @MakerTech
      @MakerTech  Před 3 měsíci +2

      Hi there and thank you so much for your feedback.
      I actually have a teaching degree.
      Later I also worked as a teaching assistent when I studied software technology and computer science at uni.
      And I'm homeschooling our two daughters.
      For your last question.
      Yes you can.
      The trick is to figure out how ;)
      Maybe start by figuring out how to check if 'E' is pressed while the player is within the doors transition area...

  • @tomoyaokazaki2138
    @tomoyaokazaki2138 Před 4 měsíci

    i'll give this a try tomorrow! I hope this works with Godot 4.2 😅i really want to have multiple scenes to go into like you showed in your video. If this works on my end, I'm definitely going to use this A LOT. Thank you so much for making this video! I asked the Godot 4 community and people just seemed confused as to why my code wasn't working.

  • @davi_horn
    @davi_horn Před dnem

    Thank you now I can rick roll my friends in new ways!

  • @JameishLestray
    @JameishLestray Před 6 měsíci +1

    LOVE IT! Thanks Maker Tech

    • @MakerTech
      @MakerTech  Před 6 měsíci

      Thanks, I'm glad you like it.

  • @VoyivodaFTW1
    @VoyivodaFTW1 Před 6 měsíci +2

    Such a wonderful tutorial.

    • @MakerTech
      @MakerTech  Před 6 měsíci +1

      Thank you so much for the feedback.
      I'm glad you like the video :)

  • @tlilmiztli
    @tlilmiztli Před 7 dny +1

    I almost gave up - for three days I was looking whats wrong - it just wasn't working. Spoiler alert - my fault entirely ;) I cant imagine but it was fault of single letter that was capital and it should not be. Now everything works like a dream - thank you :)

    • @MakerTech
      @MakerTech  Před 7 dny

      I'm so glad you figured it out what the problem was!

  • @Dlontong71
    @Dlontong71 Před 24 dny +1

    I having error on the scene manager, on the line ``player = from.player`` i got the error ``Invalid access to property or key 'player' on a base object of type 'Node2D', `` i check every thing and follow your code but i dont understand how and why this come out. can u help?

  • @pkon580
    @pkon580 Před 5 měsíci

    thank you so much for your tutorials!!!!! makes learning the progam a breeze

    • @MakerTech
      @MakerTech  Před 5 měsíci +1

      Hi and thank you for the feedback.
      I'm really glad you find the tutorials helpful :)

  • @ViacheslavZarutskii
    @ViacheslavZarutskii Před 2 měsíci +1

    I sat for over 8 hours on this video, but I never got anywhere, I just got confused. Is there somewhere I can email you to see what the problem is? I'm exhausted.

    • @MakerTech
      @MakerTech  Před 2 měsíci

      I have a Discord server where you can try to get help: discord.gg/pWWNpKFk
      I try to help out when I can, but I also have a ton of other things to do.

  • @mrgatopascuero9973
    @mrgatopascuero9973 Před 4 měsíci +6

    I just got my way out from "invalid get index 'player'" error but the next line " player.get_parent().remove_child(player)" reports that it cannot call the get_parent( ) function with a null value. Anyone know how to solve this?

    • @Bigmaster220
      @Bigmaster220 Před 4 měsíci +1

      same problem here... if anyone have a solution would be great

    • @Bigmaster220
      @Bigmaster220 Před 4 měsíci

      For me I had to add the super() to the _ready function of each level

    • @borjaespejo7814
      @borjaespejo7814 Před 3 měsíci

      @@Bigmaster220 I had the same error here, but I dont know how did you solve it. What do you mean exactly?

    • @SoarkProductions
      @SoarkProductions Před měsícem +1

      Had this issue. You have to replace:
      player = from.player
      With:
      player = from.get_node("player")

    • @mannolmusic
      @mannolmusic Před měsícem

      @@SoarkProductions Thank you so much! this solved the issue for me

  • @BLACK-NIGHT-dg1ow
    @BLACK-NIGHT-dg1ow Před 2 měsíci +2

    Does this laod the scene even if we leave it or close it or make a toturial pls

  • @alancunha910
    @alancunha910 Před 5 měsíci +3

    Using Items and deleting them from inventory seems a good addiction to me

    • @MakerTech
      @MakerTech  Před 5 měsíci +2

      That is exatcly what I'm working on today :)

    • @alancunha910
      @alancunha910 Před 5 měsíci

      @@MakerTech :)

    • @MCNeko6554
      @MCNeko6554 Před 5 měsíci +1

      I do get pretty addicted to inventory management 😂
      (sorry couldn't help myself)

  • @lucienz2519
    @lucienz2519 Před 5 měsíci +3

    Hi, I have a problem with a Player that when its change scene the error said that Node not found "Player" in inside house Scene
    func _ready():
    if scene_manager.player :
    print("Have Player")
    if player :
    player.queue_free()

    player = scene_manager.player
    print("Player in Scene")
    add_child(player
    and when i enter a scene_trigger its print out like this. I dont know why is not found when the system print like this
    Have Player
    Player in Scene

  • @Bokter
    @Bokter Před 3 měsíci

    THANK YOU VERY MUCH, SUCH A NICE TUTORIAL! 😁😁

  • @brandonjacksoon
    @brandonjacksoon Před 5 měsíci +1

    Liked and subscribed! Thank you!

  • @PersonausdemAll
    @PersonausdemAll Před měsícem

    Thank you for the good and sweet turorial.
    I wish we could create teleportevents with mouseclicks like in the rpg maker Programms 😆

  • @cheesymcnuggets
    @cheesymcnuggets Před 2 měsíci +2

    I always thought you'd have a main scene that never changes with the player and gui attached to it, and a level/world scene that's a child of the main that you could just swap out without having to re-instantiate the player and gui... is this still a viable option? To me it sounds better but I'm often wrong about these things, your thoughts?

    • @MakerTech
      @MakerTech  Před 2 měsíci +1

      You can do that as well.
      I do that in a lot of cases as well.
      I actually considered showing that solution instead, but ended up with this one because I felt it would be the easiest to get started with.

  • @Mrtargi
    @Mrtargi Před měsícem

    Thank you for tutorial! You did a great job, but I suggest not to use the root node, instead to separate main scene to multiple nodes like Level (where you load and update all levels), Player and UI. In that case the system are more convenient and modular and you don't need to queue_free everything. Anyway thanks again!

  • @enzesnow
    @enzesnow Před měsícem +1

    Hi there! Nice tutorial. May I know is there any way to do this system not only with entering some collide, but also entering collider and press button?

    • @MakerTech
      @MakerTech  Před měsícem

      Sure, you can trigger the scene change with a button press as well.
      But the you need to check if the button is pressed, and then if the player overlaps with a scene trigger.
      Try looking at the "get_overlapping_areas" or "get_overlapping_bodies" methods of the Area2D class.

    • @enzesnow
      @enzesnow Před měsícem

      @@MakerTech thank you for your answer!♪( ´▽`)

  • @JameishLestray
    @JameishLestray Před 6 měsíci +4

    If you love this arpg tutorial please drop a like so the newbies can see how much people love it!

  • @JustABitWild
    @JustABitWild Před měsícem +1

    Hey, I randomly found this video and watching it once it seemed ideal for what I had in mind for my game. Sadly it's not working, at around 12:37, in the scene_manager script I'm getting an error
    Invalid get index 'player'(on base: 'Node2D')
    Do you know why this is? Or if someone else knows that'd be great, I'm really wanting to use this system

    • @JustABitWild
      @JustABitWild Před měsícem +1

      It's specifically for the line
      player = from.player

    • @MakerTech
      @MakerTech  Před měsícem

      To use exactly as I have made it, you need your player to be a child of your scene roots and named Player.
      And you need a reference to it in the scenes script.
      It should be covered in the video.

    • @JustABitWild
      @JustABitWild Před měsícem +1

      ​@@MakerTechI followed all the way up to the point I listed, I looked it up and down and I don't think I did anything differently. In the debugger, it says that the player is . full_path also says it's . Sorry I'm just at a loss and don't know who else to ask

    • @MakerTech
      @MakerTech  Před měsícem +1

      ​@@JustABitWild But if you didn't follow the series before this video, then you setup might be different.
      This you could check:
      - The player is a direct child of the scenes root node
      - The player is called Player in the sceen tree
      - All your scenes has to have a script attached that either extends from BaseScene or is BaseScene
      - You scenes should all have an instance of the player added from the start.
      If you still can't get it to work, then consider joining the Maker Tech Discrod server and ask for help there.

    • @luquipe4938
      @luquipe4938 Před 28 dny

      @@MakerTech I was stuck with the same. My mistake was not having an instance of the player added from the start in every scene. Is there any way to improve this, like generating the instance if it doesn't exist? By the way your tutorial was amazing! I looked a lot for a similar system. Thanks!

  • @elder_newt
    @elder_newt Před 5 měsíci +3

    In Scene Manager Script, What is "var player : Player"? I can't find "Player" type

    • @MakerTech
      @MakerTech  Před 5 měsíci

      Did you figure it out?
      It is just the custom player class (scene) used for, well the player.

    • @MCNeko6554
      @MCNeko6554 Před 5 měsíci +2

      This is late but for anyone else reading, make sure your player script has a class name! Example: "class_name Player extends CharacterBody2D"

    • @chipo7308
      @chipo7308 Před 4 měsíci

      @@MCNeko6554 you saved me so much heartache thank you

  • @lliveinfearl
    @lliveinfearl Před 26 dny +1

    Thanks a lot for the video, means a lot to me... Tho I don't know what am I doing wrong the collider is just not working at all, I move player on top of the area2d with the collisions all set up and it just never reaches breakpoint... Meaning it doesn't even detect collisions with the player, I had a clunky setup to change scenes before and it was working with collisions but doesn't seem to like that is separated in scenes or something... Any ideas why is the collision getting "ignored" or not working at all?
    EDIT: Got it to work! Thanks a lot for the video, it was a dumb mistake I made, now it works like a charm! ^^

    • @MakerTech
      @MakerTech  Před 26 dny

      I'm glad you got it working :)

    • @tlilmiztli
      @tlilmiztli Před 10 dny

      I wish to know how you have solved it because I just ran into similar problem...

    • @lliveinfearl
      @lliveinfearl Před 10 dny +1

      @@tlilmiztli In my case it was that the signals were not set up properly, so the call to code was not happening at all, maybe check that and see if it's your problem too

  • @nerokun7787
    @nerokun7787 Před měsícem

    I'm having problems with the entrance markers. They keep getting ignored. I tried the fix others in the comment mentioned: to make sure that the base scene script says entrance_name instead of entance.name but nothing changes regardless or which one I use. I made sure the name of the marker matches the root node of the scene too.
    I'm not getting any errors or anything so I'm confused and not sure how to approach trying to fix this

  • @NUTTY-nw4ed
    @NUTTY-nw4ed Před 5 měsíci +2

    Hi, i really love the tutorial. I just have a question about your player. Is it instantiated in the main scene? When I follow this tutorial, the from.player is null for the node2d. I was trying to find your code for the player node to check, could you direct me? Thank you

    • @MakerTech
      @MakerTech  Před 5 měsíci

      The player is instantiated in the main scene, yes.
      And since we added and onready variable to hold the player in the script for the base scene (that all other worlds/houses/etc. will inherit from), the player should really be instantiated in all scenes (this also makes it easier to test individual scenes).

    • @NUTTY-nw4ed
      @NUTTY-nw4ed Před 5 měsíci

      @@MakerTechThank you for the quick reply, thats very helpful. I thoiught your tutorial was great, just got snagged on that part. I've liked and subscribed and will be back to watch your other vids. Keep it up. (When you say the player should be instantiated in all scenes, does that mean that at the base scene, the player always exists, and what we're doing in the tutorial, is just switching between scenes and copying over the player from the base?

    • @MakerTech
      @MakerTech  Před 5 měsíci

      @@NUTTY-nw4ed All our worlds/places has either the base scene script or a script that extends from this.
      So they all have their own version of the player when they load.
      But we then remove this original player and replace it with the one from the previous scene, when we change scenes.
      So in reality we only every use the player from the very first scene we are playing in.

  • @see-lingjanapollo-bsit5258
    @see-lingjanapollo-bsit5258 Před 4 měsíci +2

    Hi :) Its my first time creating game and your videos are really helpful. However, I have this problem "Invalid set index 'global_position' (on base: 'hull instance') with value of type 'Vector2'" I encountered this when changing scenes huhuhu by any chance do you know how to fix this? Thankiesss

    • @MakerTech
      @MakerTech  Před 4 měsíci +1

      The 'null instance' error tells you, that the object doesn't exist.
      So you would have to find out why the object you are trying to set the global_position for isn't there.
      I'm guessing it is the player?
      Maybe it isn't set correctly from the old scene before the change?

    • @elloCHLOE
      @elloCHLOE Před 3 měsíci

      Hiiii I'm having the exact same problem! Did you ever figure out how to fix it?

  • @DonMilo
    @DonMilo Před 6 měsíci +1

    Thanks!

    • @MakerTech
      @MakerTech  Před 6 měsíci

      And thank you!
      I'm glad you liked the video :)

  • @steveevets1130
    @steveevets1130 Před 5 měsíci +2

    Great video. Do you make the code available? I searched for a github but found nothing.

    • @MakerTech
      @MakerTech  Před 5 měsíci

      At the moment it is only available as a reward for some of my patreons.

    • @steveevets1130
      @steveevets1130 Před 4 měsíci

      @@MakerTech That is fair enough. Your videos are very helpful, so thank you.
      In this particular video I would suggest two things:
      1. You are right that scene transitions are going to be many and varied but town-door transitions are going to be very much the same each time. Rather than redraw the collision shape for each of those I would create a town-door scene and instantiate. There are bound to be quite a few.
      2. Building file paths the way you are doing restricts your scene manager to that path. It is just as easy or even easier to just drag the complete file name from the file manager into the code window (or into the export variable). So if you want to transition to a scene that is not at the standard source path you don't have to build a separate handler for it.

    • @MakerTech
      @MakerTech  Před 4 měsíci

      Sure there are a lot of ways to handle scene changes like this.
      I just try to give an open solution that people can then expand on as they wish (or simplify it that fits their game better).

  • @TheJoyceGabi
    @TheJoyceGabi Před 5 měsíci +1

    Hi there! Have been going through yours tutorials to use it in my own game but just found a problem now. Don't know if you can help me? I place the trigger where I want my player to appear but he appear in another place, however ir always in the canvas normally. I am not using follow cam, just doing scenes that fit the game screen. I want to make him appear in X place because of the door etc would be better if someone is playing. If you have an idea of what is causing this pls tell me and again THANK YOU VERY MUCH!!!!

    • @MakerTech
      @MakerTech  Před 5 měsíci

      Hi there.
      Did you find a solution to your problem?
      If not, then you can also join the Maker Tech Discord server.
      It is usually a lot easier to help out on Discord and similar places, than in these comments on youtube.

  • @chewienl7401
    @chewienl7401 Před měsícem

    it works great however i have 1 question: is it possible to implement a function with a button pressed to trigger the scene change, like some closed doors and some open like this one in the same script or do i need to make 2 scripts for that? 1 for this one and 1 with button pressed to enter?
    super tutorial btw

    • @chewienl7401
      @chewienl7401 Před měsícem

      i suddenly get the error: cannot find member player in base scenemanager? even though it worked briefly before

    • @MakerTech
      @MakerTech  Před měsícem

      Hm, I guess you could use just one and have an exported variable that determines if the transition is triggered with a button press, or just like in the video.
      However, I think I would prefer it to be two different classes.
      Maybe one could extend from the other? Hm...

  • @grantcreach1315
    @grantcreach1315 Před 3 měsíci

    I'm having trouble with the camera. My other scene needs the camera but if I walk into the next scene I'll get errors

  • @kidhates6629
    @kidhates6629 Před měsícem +1

    great tutorial! Quick question, how do we re-attach the follow camera to a new scene?

    • @MakerTech
      @MakerTech  Před měsícem

      You have to think of a solution using some of the same things we used in this tutorial.
      The scene has to either have the base scene script attached or one that inherits from the base scene.
      This script has a variable for the camera.
      When do you then think, that we should update the camera to follow the player we added from the scene manager?🤔

    • @samsonherman4282
      @samsonherman4282 Před měsícem

      @@MakerTech I am having an issue where upon entering the new scene, my follow camera script is trying to get the global position of the camera, but it was freed from memory at some point, crashing the game. The new scene has the base scene script attached, the camera is a direct child of the scene node, and it's follow node is set to the player. There must be a step I am missing to reinitialize the camera, but I am not sure what that step is because the camera is already a child of the scene.
      exact error message: Invalid get index 'global_position' (on base: 'previously freed').

    • @MakerTech
      @MakerTech  Před měsícem

      @@samsonherman4282 Did you update the cameras follow node to be the transfered instance of the player?

    • @samsonherman4282
      @samsonherman4282 Před měsícem

      @@MakerTech Do I do that in the _ready function of the follow camera script? I tried a solution like this but I received a null instance error of the same type as previous. I even tried making a follow camera class and inheriting it in the base scene with no luck.
      The error happens when I set the player to the instance of the player already in the scene, so the error makes sense, as that instance is freed from memory. I am just stuck with where and how to update the follow node to include the transferred player.
      One difference in my code is that I am not using the scene trigger as you are. I already have an interaction manager and interaction areas that require the player to give input to do things like trigger dialogue or a scene change, but this should not affect the camera, and my code works fine if I do not set the follow node to be the old player instance.
      I am having a lot of trouble with this unfortunately

    • @MakerTech
      @MakerTech  Před měsícem

      @@samsonherman4282 It has been a while, so I'm not 100% sure what solution I tested.
      But I'm thinking you need a method in the camera for setting the player.
      And then in your Base Scene script you can call the method right after you get the player from the scene manager.
      You can't use the cameras ready method because this is called before the ready method in the script for the scenes root node.

  • @Jackmang-fk3fq
    @Jackmang-fk3fq Před 25 dny

    11:50 Why does my Godot display invalid get index "player"😢

  • @denilsonporto3350
    @denilsonporto3350 Před 5 měsíci +1

    This tutorial was very helpful. I found out about the persistent player problem in my own game when I changed my scene and the player reset. Your solution fixed that issue and I was very excited until...how do I keep the old scene persistent. The player doesn't reset anymore but the scenes do. Items that have already been acquired, like zelda heart containers, respawn.

    • @MakerTech
      @MakerTech  Před 5 měsíci

      Depending on how many scenes your game has, and how big they are, you most likely don't want to keep all scenes loaded after you leave them.
      In this case what you need is some way to save the state of a scene when it leaves scene tree, and then load it back in when it enters the scene tree.

    • @denilsonporto3350
      @denilsonporto3350 Před 5 měsíci

      LOL I did come up with an idea for a solution but it isn't very satisfying. I am basically going to have an array of bools has_heart[index]. If the player has that heart I will queue_free the heart item instance@@MakerTech

  • @notnorthkai
    @notnorthkai Před 5 měsíci

    Hmmm...quick question; Would this method allow the current state of your health to be transferred to the new scene? I cant see the GUI in the house segment so I figured i'd ask before trying the autoload method over the other(s)。✌🏿

    • @MakerTech
      @MakerTech  Před 5 měsíci +1

      The player is a part of the player scene, so yes it transfers.
      I just didn't add the gui items to the scene for the inside of the house, that is something for you to explore :)

    • @notnorthkai
      @notnorthkai Před 5 měsíci

      ​@@MakerTech Arghhh 🦜...okay, heh。 Thanks! 🕹️

  • @QuanNguyen-cr7
    @QuanNguyen-cr7 Před 3 měsíci

    nice

  • @Harold-i6g
    @Harold-i6g Před 4 měsíci +1

    I keep getting the error 'invalid get index 'player' ' from the line 'player=from.player'. Am I doing anything wrong?

    • @MakerTech
      @MakerTech  Před 4 měsíci

      Did you remember to add an onready variable to the base scene script?
      Maybe try watching the video again and make sure you understand each step before moving on to the next

    • @ian3857
      @ian3857 Před 4 měsíci +1

      @@MakerTech Im getting the same error too, it happens in the scene_manager script before we write the base scene script

    • @MakerTech
      @MakerTech  Před 4 měsíci +1

      @@ian3857 Then you need to look in the script for the scene you are moving away from. It has to have a variable for the player for this to work.

    • @ian3857
      @ian3857 Před 4 měsíci +1

      @@MakerTech Hey thank you! It worked im on to the next part of the video. Thanks for making these tutorials

    • @MakerTech
      @MakerTech  Před 4 měsíci

      @@ian3857 Great!

  • @RealVai1d
    @RealVai1d Před 4 měsíci

    Hey I think I made a mistake placing something or in the code but I get an error "Node not found: "Player" (relative to "/root/InsideHouse")" . wanted to know if you could help. Thank you

    • @RealVai1d
      @RealVai1d Před 4 měsíci

      I also cannot move the player at all in this state when i go into the room

    • @MakerTech
      @MakerTech  Před 4 měsíci

      Did you find the problem?
      It sounds like you either did not add an instance of the player to the scene for insider the house.
      Or maybe the player isn’t at the correct path in the scene tree.

  • @calibur5518
    @calibur5518 Před 4 měsíci +1

    19:58 what have you done in this part ? :(

    • @MakerTech
      @MakerTech  Před 4 měsíci +1

      "Select the camera and add the player in the inspector menu"

    • @calibur5518
      @calibur5518 Před 4 měsíci

      @@MakerTech Hiii i did but i have this error(Node not found: "Player" (relative to "/root/InsideHouse") still working on it

    • @MakerTech
      @MakerTech  Před 4 měsíci

      The error tells us, that you don't have an instance of the Player class added as a child of the InsideHouse scene.

  • @jasonwilliams8730
    @jasonwilliams8730 Před 6 měsíci +1

    👍

  • @fizzydrinkuno
    @fizzydrinkuno Před 3 měsíci

    how do you full_path in Godot

  • @carbunky6098
    @carbunky6098 Před 2 měsíci

    How do you register the player with the SceneManager if it's an autoload?

    • @MakerTech
      @MakerTech  Před 2 měsíci

      You don't.
      You always just get the player from the previous scene.

    • @JasonDahlA
      @JasonDahlA Před 26 dny

      @@MakerTech I'm not sure where you initially called "change_scene" then. On first loading the game the player on the scene_manager will be null

    • @MakerTech
      @MakerTech  Před 26 dny

      @@JasonDahlA When the player is null in the scene_manager, then we just use the player instance that is in the scene from the beginning.
      And when we change scenes then we set the player in the scene_manger to be the one from the previous scene before changing to the new scene.

  • @kerlak-4246
    @kerlak-4246 Před 2 měsíci

    спасибоооооо!!!!!!!!!!!!!!!!!!!!!!!!!

  • @Tbonesteaks
    @Tbonesteaks Před 4 měsíci

    12:12 what does var player : player and player = from.player

    • @tomoyaokazaki2138
      @tomoyaokazaki2138 Před 4 měsíci

      var player: player refers to the class_name player (which is the class name given in your player script). Which means if you use this code from the video, your player script extension should look like this: class_name player extends CharacterBody2D
      As for player = from.player....i'm just as confused as you are tbh..
      I noticed this video tutorial is not really compatible with Godot 4.2

    • @AlphaFrameOfficial
      @AlphaFrameOfficial Před 4 měsíci

      @@tomoyaokazaki2138 This tutorial is plenty compatible with 4.2.
      To clear up the misunderstanding player = from.player is passing in the player from the previous scene. That way we can utilize it later in the most current scene.

  • @coolplay1338
    @coolplay1338 Před 5 měsíci

    Are ungirl

  • @Spaced0ut000
    @Spaced0ut000 Před 5 měsíci +1

    this is extremely confusing for a beginner because of all the going back and forth. genuinely don't understand why you couldn't have done it right the first time and just go over mistakes naturally as they happened. wasted my time with this video.

    • @MakerTech
      @MakerTech  Před 5 měsíci +7

      I'm doing the videos in the same order, as I would normally develop the solutions.
      This is on purpose, because the most important thing, if you really want to learn game dev, isn't to just get the solution and understand it afterwards.
      Instead it is to experience and understand the process itself.
      Also, changing scenes like this isn't really a simple a task as one would hope.
      So in a lot of ways it just isn't a very beginner friendly topic - at least not if you are also new to programming.

  • @lorein_4368
    @lorein_4368 Před 2 měsíci +1

    someone has a problem that the player appears in the world not at the set point, when leaving the house, but where he appears when loading the world. that is, the player enters the house easily and appears where he needs to, and when he needs to go back out, he teleports?🥲🥲🥲

    • @maedemeier
      @maedemeier Před měsícem +1

      I had a similar problem. Compare your script again with 27:01. There were again changes from entrance.name to entrance_name.

    • @nerokun7787
      @nerokun7787 Před měsícem

      @@maedemeier I'm havin'g the same problem and at first I thought it was entance. name instead of entrance_name but correcting it changed nothing. Do you have any idea?