Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

Hey there, i am also having the exact same error on logs from people that tried my demo and had random crash when scene transitioning (can't reproduce the crash myself). Using 4.0 too. What was the cause of this error for your case and how did you fix it?

(1 edit) (+1)

Hi, I am replying from my other account. It was a bug solved in Godot 4.2 related to change_scene. If you can't upgrade, the way to fix it is to avoid using the built-in change_scene and instead have a main scene with a parent Node and your current scene as a child. When you change scene, you delete the child normally and then swap it with the newly loaded scene that should replace it. This solved the issue in Godot 4.0 for me!


Please do note that this bug ONLY happens in release versions and NOT in Debug/in-editor versions!

(+1)

Thank you very much! I will try these.

Your game looks cool btw!

(+1)

My pleasure. Let me know if you still have troubles, worst case scenario I can simply show you my code! 

Here's how I set up my project: SceneManager is a singleton that implements the goto_scene method. When the method is called, it emits a signal "switch_scene" which is wired to another goto_scene function in the MasterScene object. The MasterScene then frees the current scene (the only child) and instantiates a new child with the required scene type.

I hope this helps!

Damn that's really helpful. I tried upgrading to 4.2 but got some little issues so i will probably use your method instead. Thanks a ton!