Node A has Node B as child but Node B does not have Node A as parent

Godot Version

4.7.1

Question

I literally have no idea what is going on. Everything was working fine until i added an extra box mesh to the scene and now nothing works.

I did some debugging and it turns out that the node “superchunk” needs data from its parent to work, but after adding the box mesh it no longer has a parent. Before i added the box mesh it recognised its parent just fine.

The weirdest thing is though when i check the node that should be the parent of the superchunk it states that the superchunk is its child.

So the parent recognises the child but the child dosent recognise the parent… i dont know if its my code making it do this but i have no idea how that would even work, why would an extra box mesh cause it? an empty mesh dosent break everything but a mesh like a box or plane mesh does? I could technically change the code so superchunk dosent need to have a parent to work but i dont want to keep coding with something that seems incredibly bugged as it could cause problems in the future when i could just use a backup which works. But i spent half the day working since the backup and dont want to lose my progress.

Does anyone have any idea what is going on?

First the parent shows its children
Then its children state what they are
Then an error message
But as you can see the children’s ID’s are the same ID’s as in what should be the parents array (array of children was generated with get_children()).

Note: i have tried to reparent the superchunk to the parent its meant to have, but it still says it has no parent. No error message saying the reparent didnt work either, it just says it dosent have a parent.

Ignore me, i found the problem, my code was bad. I made it so that when it states “Superchunk has no parent” it is because it has checked to see what ID it’s parent has and only continues if it has a very specific ID. When i added the box mesh it changed the ID of it’s parent.

I cant seem to delete this post tho

Don’t feel the need to delete the topic once you have figured it out. Do what you did - explain what went wrong and how you fixed it. You can mark this post as the solution. One day, someone may have a very similar question, and this thread may help them to solve it.