#Unable to change scene back to main menu node

36 messages · Page 1 of 1 (latest)

craggy harness
#

So basically, I have a very simple game of a main menu node and a level node. I can switch effortlessly from the main menu node to the level node by preloading the level node and using it with change_scene_to_packed(), however, I can't do the same when transitioning from the level node to the main menu node. I have a button that, when pressed, emits a signal that then triggers the function to go to the main menu. the problem is I'm always met with this debugger error:

#

I've tried using change_scene_to_file() with the scene path to the node but that also returns the same error. It's really weird...

royal geyser
#

Can you open your menu scene in the editor?

craggy harness
#

sure, here is the scene with the tree

#

here is the code

#

here is the custom_change_scene_tp()

#

I can assure you this isn't the issue as when switching back from the level I've not used this and instead used bare functions.

royal geyser
#

That is weird... can you try using that to switch to an empty scene?

craggy harness
#

an empty scene as in it doesn't even have a node in it?

#

I can't create something like that. maybe just a regular node?

royal geyser
#

You can try switching to any scene. We just need to check if only your menu is affected.

craggy harness
#

I can and it works fine

#

the autoload isn't the issue, from inside the level itself I can't call any of the bare functions that are used to switch scenes, let me demonstrate with a video

#

Oh wait, from inside the level I can change to the empty scene I just created

#

I only can't switch to main menu

royal geyser
#

Does your menu have other dependencies?

craggy harness
#

can you elaborate on dependencies? I don't think it does...

royal geyser
#

If you don't mind sharing, what does your main menu script look like?

craggy harness
#

main menu script

#

TransitionEffect is an autoload

#

let me try commenting all the code out and starting from the level itself

#

it works that way

#

something in the code must be interfering

royal geyser
#

Is your level scene preloading your main menu?

craggy harness
#

nope

#

this is odd but I think it has to do with all the preloading that's going on

#

let me instead use switch_to_file and see if that fixes it

#

by the way, the level wasn't preloading the main menu node, it was the pause menu node which is a child of the level node that was preloading it:

royal geyser
#

This is the closest thing I can find relating to your issue.
Apparently, scenes can also run into trouble with cyclic references if they preload one another.

https://github.com/godotengine/godot/issues/72921#issuecomment-1423244325

GitHub

Godot version 4.0 RC 1 System information Windows 10 Issue description I cannot switch back to the packed scene that I start in. Hard to describe, so see the minimal reproduction project if my desc...

craggy harness
craggy harness
royal geyser
#

nice! good luck with your project!