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

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

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

  • @hexaldecima6839
    @hexaldecima6839 10 месяцев назад +15

    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  10 месяцев назад +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.

  • @Normit08
    @Normit08 9 месяцев назад +51

    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  9 месяцев назад +7

      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 5 месяцев назад +3

      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.

  • @uferis
    @uferis 28 дней назад +5

    11:04 If anyone else missed something like I did and is getting an error for the "Player". Its because the "Player" is a class name and should be named in the Player nod, like that: class_name Player extends CharacterBody2D

  • @teahands
    @teahands 10 месяцев назад +11

    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  10 месяцев назад +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.

  • @RobertoGongora
    @RobertoGongora 10 месяцев назад +5

    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  10 месяцев назад

      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.

  • @MCNeko6554
    @MCNeko6554 9 месяцев назад +26

    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  9 месяцев назад +1

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

    • @tomoyaokazaki2138
      @tomoyaokazaki2138 8 месяцев назад +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 6 месяцев назад

      Thanks!

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

      THANK YOU SO MUCH

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

      OMG thanks so much!

  • @allstarspixel
    @allstarspixel 6 месяцев назад +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.

  • @Dailyfiber_98
    @Dailyfiber_98 Месяц назад +1

    I absolutely love your style of tutorials. Its EXACTLY what I've been looking for. Don't stop being you!

    • @MakerTech
      @MakerTech  Месяц назад

      Thank you so much, it means a lot :)

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

    Thanks!

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

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

  • @meddlin512
    @meddlin512 5 месяцев назад +4

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

    • @MakerTech
      @MakerTech  5 месяцев назад +2

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

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

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

  • @itsthekomar
    @itsthekomar 10 месяцев назад +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  10 месяцев назад +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

    • @toddkronenberg4126
      @toddkronenberg4126 3 месяца назад

      @@MakerTech oh that's cool you have a public trello board for this. Cool to see what is coming up. I think I'm gonna end up just watching all your videos eventually haha

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

    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!

  • @alancunha910
    @alancunha910 9 месяцев назад +3

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

    • @MakerTech
      @MakerTech  9 месяцев назад +2

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

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

      @@MakerTech :)

    • @MCNeko6554
      @MCNeko6554 9 месяцев назад +1

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

  • @TsundokuGenesis
    @TsundokuGenesis Месяц назад +1

    that's a fantastic tutorial, thank you!

    • @MakerTech
      @MakerTech  Месяц назад +1

      Your welcome :)
      I'm glad you liked the tutorial.

  • @Jackmang-fk3fq
    @Jackmang-fk3fq 5 месяцев назад +2

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

  • @VoyivodaFTW1
    @VoyivodaFTW1 10 месяцев назад +2

    Such a wonderful tutorial.

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

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

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

    What do I do if when I return to the first scene, I am returned to the initial player position?

  • @rp_wavv
    @rp_wavv 3 месяца назад

    Thank you for these fantastic tutorials! 🎉

    • @MakerTech
      @MakerTech  3 месяца назад

      Thank you for watching :)

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

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

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

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

  • @mrgatopascuero9973
    @mrgatopascuero9973 8 месяцев назад +7

    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 8 месяцев назад +1

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

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

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

    • @borjaespejo7814
      @borjaespejo7814 7 месяцев назад

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

    • @SoarkProductions
      @SoarkProductions 5 месяцев назад +1

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

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

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

  • @BackSpace101
    @BackSpace101 11 дней назад

    Hey, Great video!
    I'm stuck on 8:27 with setting a name for my scene trigger name thing, I have mine as
    @export var connected_scene: String #ShopRoom
    ShopRoom is the name of the file with my Room but im not sure if I need a hashtag or type 'string'. is string the name, what name did you use?

  • @lucienz2519
    @lucienz2519 10 месяцев назад +4

    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

  • @cheesymcnuggets
    @cheesymcnuggets 7 месяцев назад +3

    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  7 месяцев назад +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.

  • @BLACK-NIGHT-dg1ow
    @BLACK-NIGHT-dg1ow 6 месяцев назад +2

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

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

    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?

    • @haitangs5100
      @haitangs5100 3 месяца назад

      hello i know this is one month old but I'm also having the same problem, did you manage to figure it out?

    • @Dlontong71
      @Dlontong71 3 месяца назад

      @@haitangs5100 no sorry bro, i just gana use a simpler method to change scene for my game

    • @SimmiLP
      @SimmiLP 3 месяца назад +1

      @@Dlontong71 player = from.get_node("Player") worked for me

    • @FDKeroks
      @FDKeroks 3 месяца назад +1

      @haitangs @ Dlontong Don't know if it helpes, but I renamed "player" to "player_in_scene" in my Base Scene script and that's why I got the error. What you need is to change "from.player" to "from.[insert the name of the players variable in your Base Scene script]". So for my case it was from "from.player" to "from.player_in_scene"

    • @zaherimiento
      @zaherimiento 2 месяца назад

      @@SimmiLP Thank you, my hero!

  • @ViacheslavZarutskii
    @ViacheslavZarutskii 6 месяцев назад +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  6 месяцев назад

      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.

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

    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.

  • @elder_newt
    @elder_newt 9 месяцев назад +3

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

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

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

    • @MCNeko6554
      @MCNeko6554 9 месяцев назад +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 8 месяцев назад

      @@MCNeko6554 you saved me so much heartache thank you

  • @Bokter
    @Bokter 7 месяцев назад

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

  • @basimcool9278
    @basimcool9278 4 месяца назад +1

    Thank you so much i finally did it!

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

      And thank you for watching :)

  • @brandonjacksoon
    @brandonjacksoon 9 месяцев назад +1

    Liked and subscribed! Thank you!

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

      Awesome, thank you!

  • @JustABitWild
    @JustABitWild 5 месяцев назад +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 5 месяцев назад +1

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

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

      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 5 месяцев назад +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  5 месяцев назад +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 5 месяцев назад

      @@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!

  • @shimo3178
    @shimo3178 3 месяца назад

    This tutorial helps a lot as most are out of date or don't work like this one. The only thing I notice is that when loading the new scene the character retains the default idle animation. How would you go about making the character go into the new scene while facing the direction they just came from without looking somewhere else.

  • @Nanaya-b6q
    @Nanaya-b6q Месяц назад +1

    great video, i just have one question. Is there any way I can update the objects every time the Scene changes? For example, SceneA has 2 objects and I queue_free() 1 of them, then I switch to SceneB and switch back to SceneA and it still only has 1 object

    • @MakerTech
      @MakerTech  Месяц назад +1

      You need some kind of save system for it to work properly.
      Or you would need to keep both scenes in memory at the time - but that isn't really a viable solution if you have more than a few scenes.

  • @cleanwithemma7826
    @cleanwithemma7826 7 месяцев назад +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  7 месяцев назад +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...

  • @enzesnow
    @enzesnow 5 месяцев назад +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  5 месяцев назад

      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 5 месяцев назад

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

  • @ZeLlamataur
    @ZeLlamataur 3 месяца назад

    I've been having an issue where it sets the starting position of the player to where the marker is rather than the actual start, could someone help?

  • @steveevets1130
    @steveevets1130 9 месяцев назад +2

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

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

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

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

      @@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  9 месяцев назад

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

  • @kidhates6629
    @kidhates6629 6 месяцев назад +1

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

    • @MakerTech
      @MakerTech  6 месяцев назад

      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 5 месяцев назад

      @@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  5 месяцев назад

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

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

      @@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  5 месяцев назад

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

  • @calibur5518
    @calibur5518 8 месяцев назад +1

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

    • @MakerTech
      @MakerTech  8 месяцев назад +1

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

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

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

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

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

  • @Snowmon89
    @Snowmon89 3 месяца назад

    This is both exciting and frustrating. I love how you make the lessons clear and precise and attempt to help us understand WHY something works and doesn't work.... however, it feels as if every time I get it to work, something else breaks. At one point, I finally had the transitioning from one scene to the next working perfectly, but then when I get to the positioning step BOOM it suddenly stops working (fixed that one as for some reason the "target scene" came loose). Then BOOM again now suddenly decides that it doesn't know what a "player" is and that I have to "identify" it despite I don't see how it would not know (yes, even checked the upper and lower cases, and the spacing among other simple mistakes)
    I genuinely wish I could work on this with someone else in the room, at leas for a second pair of eyes or exp to learn from. I've been trying to use this very video for the past two days and UGH....
    Sorry, just had to put the rant out there. At this point, I'm just going to start over from scratch (this is just me learning after all) and see if there's something from earlier videos that I may have missed or if some lessons I'm using are mixing up with each other.

    • @Snowmon89
      @Snowmon89 3 месяца назад

      Ehem... Just in case other people are having this trouble.
      I'm pretty much at the Entrance markers portion of the video. The line that's not working is the @onready var player: Player = $Player
      Error: "trying to assign value of type 'player.tscn:GDscript.... ect" to a variable of type 'player.gd'

    • @MakerTech
      @MakerTech  3 месяца назад

      Congrats you are now a real developer.
      Sometimes it can be like a game of chess.
      You feel like you have figured everything out, you have your plan, make your move... and then you realised that you missed something, and now you game is screwed up.
      If you havn't already, then I would recommend that you join the Maker Tech discord server and/or the Godot discord server and work on being part of the community.
      Ask for help, ask questions about things you are wondering about etc.
      It might not be the same as having someone right next to you, but it can be something :)
      (I'm very lucky when it comes to this because my husbond is also a software developer, so we often talk about software related issues).

  • @ProfRisol
    @ProfRisol 2 месяца назад

    why i got "Invalid access to property or key 'player' on a base object of type 'Node2D'." error? am i missing something?

    • @babyl
      @babyl Месяц назад

      hey did u fix it

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

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

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

      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 8 месяцев назад

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

  • @NUTTY-nw4ed
    @NUTTY-nw4ed 9 месяцев назад +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  9 месяцев назад

      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 9 месяцев назад

      @@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  9 месяцев назад

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

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

    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

  • @ahmadabdallah2896
    @ahmadabdallah2896 3 месяца назад

    if i want to preserve the state of the world as it was (enemies killed to stay killed, items harvested to not respawn) what should i do? i need to make the house scene a child of the tree, make the player a child of it, hide the world scene, show the house scene, and when coming back to the world (exiting the house) i will move the player back and remove the house scene from the tree (to preserve memory). is my approach correct or not? or a better question, is there a better approach?

  • @grantcreach1315
    @grantcreach1315 7 месяцев назад

    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

  • @CJ2CUTE
    @CJ2CUTE 2 месяца назад

    I love the mini ninjas

  • @rohithreddy75
    @rohithreddy75 3 месяца назад +1

    The colours of the game look good,can you make a video on that?

    • @MakerTech
      @MakerTech  3 месяца назад

      I didn’t create the art in this specific asset pack.
      But I do make the pixel art first my own game projects, and my advice would be to just go to lospec.com, find a few palettes you like and start from there.

  • @MiragetheGame
    @MiragetheGame 3 месяца назад

    I'm still very new, but can you have some of the scene triggers be when the body enters the collision and others when you you right click the space like an Input.is_action_just_pressed? Would i need to make a different scenetrigger set up for my clickable entrances then my entering the collision trigger?

  • @MissedtargetDev
    @MissedtargetDev Месяц назад +1

    Commenting for the algorithm, great video although damn if it doesn't seem impossible at first blush.

    • @MakerTech
      @MakerTech  Месяц назад

      Hah, I'm glad you got it to work (I'm assuming? ;) )

  • @taikuuttalvi
    @taikuuttalvi 5 месяцев назад +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  5 месяцев назад

      I'm glad you got it working :)

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

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

    • @taikuuttalvi
      @taikuuttalvi 4 месяца назад +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

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

    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 5 месяцев назад

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

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

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

  • @see-lingjanapollo-bsit5258
    @see-lingjanapollo-bsit5258 8 месяцев назад +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  8 месяцев назад +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 7 месяцев назад

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

  • @TheJoyceGabi
    @TheJoyceGabi 9 месяцев назад +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  9 месяцев назад

      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.

  • @Harold-i6g
    @Harold-i6g 8 месяцев назад +1

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

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

      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 8 месяцев назад +1

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

    • @MakerTech
      @MakerTech  8 месяцев назад +2

      @@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 8 месяцев назад +1

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

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

      @@ian3857 Great!

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

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

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

    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  9 месяцев назад +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 9 месяцев назад

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

  • @mikerocksgames6370
    @mikerocksgames6370 3 месяца назад

    changing it to a call_deferred broke it for me like straight on not putting me in the room like the vid

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

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

  • @carbunky6098
    @carbunky6098 6 месяцев назад

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

    • @MakerTech
      @MakerTech  6 месяцев назад

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

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

      @@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  5 месяцев назад

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

  • @Mrtargi
    @Mrtargi 6 месяцев назад

    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!

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

    how do you full_path in Godot

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

    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 8 месяцев назад

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

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

      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.

    • @Irategamefan
      @Irategamefan 3 месяца назад

      @@MakerTech You never added a instance to the lvl through out the video or was that a step I missed some where when you where working on the inside scene?

  • @tlilmiztli
    @tlilmiztli 4 месяца назад +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  4 месяца назад

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

  • @denilsonporto3350
    @denilsonporto3350 10 месяцев назад +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  10 месяцев назад

      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 10 месяцев назад

      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

  • @QuanNguyen-cr7
    @QuanNguyen-cr7 7 месяцев назад

    nice

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

    👍

  • @kerlak-4246
    @kerlak-4246 6 месяцев назад

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

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

    Are ungirl

  • @Spaced0ut000
    @Spaced0ut000 9 месяцев назад +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  9 месяцев назад +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 6 месяцев назад +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?🥲🥲🥲

    • @meddlin512
      @meddlin512 5 месяцев назад +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 5 месяцев назад

      @@meddlin512 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?