For some reason I get two instances of this running. One under “@node” and one under “root”
Both of them run all of the scripts.
(Related to Number Operations & More Printing | GameDev.tv) course…
For some reason I get two instances of this running. One under “@node” and one under “root”
Both of them run all of the scripts.
(Related to Number Operations & More Printing | GameDev.tv) course…
That sounds quite odd. It’s very early in the course to be running into something like that.
Could you post your scene tree and the Remote tab? Your level and player scripts would also be helpful to rule some things out.
Wow. Well, it really is exactly as you identified (not that I doubted you, I’m just surprised): in addition to the level instance you have at designtime, the level scene is also being instantiated again at runtime. Because nodes cannot have identical nodepaths, and Level1
is already taken as a name, Godot will rename the instantiated one automatically, and that’s what you’re seeing there as @Node2D@2
.
The only thing I can think of that might do this is if you have a Global Autoload that starts the level, but you also have the level set as the main scene in the Project Settings. I don’t think Autoloads have even been introduced yet at this point.
Your best bet will likely be to upload your project. Darren and/or Marc can explore it more thoroughly than I can. @Marc_Carlyon @OboShape
I agree here, There is nothing in the code that would do this and the naming of @Node2D@2 says to me that its instantiating a second Level1 at runtime.
I would check the project settings under the project menu and check that there is nothing in the auto load tab to rule out it being added there.
If this is not the case the only thing i can think of is to make a new project and see if it occurs there and that its a bug in 4.2.2 that we havent encountered before.
Let us know how you get on
I shouldn’t have taken so long to make a repository for this. Here we go!
Now I can also switch between machines with less hassle
Yup the Auto Load tab had the Level1 scene in it, so that was done when I was trying to follow along and figure out how to manually make it auto load the scene I want instead of having it set when I hit play. Easy mistake, easily fixed.
Thanks again!
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.