Cannot find child entity of parent "Root" - Editor error, can't delete entities

We have a repro for this in the following ticket: Scene corruption where an Entity will have the same child listed twice in the Editor data · Issue #758 · playcanvas/editor · GitHub

We aren’t sure if this is the only cause of the issue though

The main issue with this is by the point people get the error message, it’s too late. We would need the steps leading up to the issue itself.

@yaustar Thank you for the information. I will watch for this to occur again and hopefully catch some more data since I have experience the occurrence.

I did all the steps and was able to fix my project… but I can no longer reparent an entity…

I was thinking maybe if I tried doing it the dev console way It would fix the problem but I can’t do it that way because It’s blocked on my school computer…

Help? I have to submit my project for a make-a-game contest at school after this month!
I don’t want to publicly put out the link to my project yet but for anyone that can help me I’ll send the link to you privately.

DM it to me and the branch that you are on/has the issue

1 Like

:+1: ok

Confirmed it’s not an Editor/Scene corruption issue

1 Like

4 posts were split to a new topic: Cannot duplicate entities - Editor says ‘Error saving changes’

Hi, we’ve encountered this bug today. And we can’t create a checkpoint by the way. How can we solve this?

Dang this glitch is still happening? Its actually quite easy to fix.

Open up the editor and go to the scene where this error is happening.
Press CTRL + SHIFT + I to open inspect element
Move to the “console” tab
You should see something that looks like this:


That blue arrow is where you will paste the following code:

const entity = editor.entities.get('XXXX')

Replace the XXXX with the entire entity id of the parent and press enter (dont remove the ')
After you have done that paste the following code:

(function(removeGuid) { const children = entity.get('children'); const newChildren = []; for(let i = 0; i < children.length; i++) { if (children[i] !== removeGuid) { console.log(children[i]); newChildren.push(children[i]); } } entity.set('children', newChildren); })('YYYY')

This time replace YYYY with the entire entity id of the child and press enter
Then just refresh the page and it should be fixed.

Thank you! I’ll try it soon and let you know if it works.

1 Like

Yes! It works!
YOU SAVE MY DAY!!! :raised_hands:

Honestly im surprised this is even still a thing that can happen, I thought it was fixed. This is a problem that has been happening for years. When I first encountered it there was no fix like this so I had to manually move every single entity to another scene. Twice.

I did the same move every single entity thing when there’s no reply
Move everything under a parent, make it a template. Paste the root’s scripts :rofl:

Sounds alot better then when I had to spend multiple hours moving thousands of entities