0 votes

Hi!

So, I have this project that tries to emulate those old videogames that used videos inside an interface (e.g. Los Justicieros). As such, every scene switch is happening inside the panel that holds the "scenes" inside the interface, erasing the previous node and instancing the new. I used this article from the documentation as the base of my code, however, something weird is happening. Sometimes, seemingly at random, when the scene is switched, some nodes of the scene are missing.

enter image description here

I tried to instance the scene, duplicate it, add one of the instances to the scene tree root and the other to the scene container and, by using the remote scene view, I could check that when something is missing in the scene, it isn't missing in the duplicate node, so the problem must be occuring when adding the child to the scene container.

I'm really not sure if this is a problem with the engine or I made a mistake with my code, and I couldn't replicate the bug on an empty project, so I don't know if I should report it.

I uploaded a sample of the project here. I only included a scene with the shop because is where this happens the most, but I observed this happening on other scenes as well.

The photo icon at the bottom right reloads the scene. By clicking repeatedly you can observe the issue. This happens either on Godot 3.1.1 and Godot 3.2.alpha

To wrap up, I guess what I'm asking is: Am I doing something wrong? Should I report this even though I can't replicate it? Is it possible that the project is corrupted somehow?

asked Oct 14, 2019 in Engine by InterDan (28 points)
edited Oct 14, 2019 by InterDan

Some observations:

It seems that this happens even without the interface frame setup, using the get_tree().change_scene(path) method.
Deleting some nodes in the scene solves the issue. Maybe there's a limit of nodes you can parent at once?

1 Answer

0 votes
Best answer

I think I figured out the problem. I was freeing a node that was part of the scene at the same time I was freeing the scene itself. However, I'm still unable to reproduce this in other project, so that might not be the actual problem/solution?

Anyway, if anything was learned, always remove the node from the parent before you free it.

answered Oct 15, 2019 by InterDan (28 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.