More than one root entities in Scene


I have a problem with one of the scenes in one of my projects.
I can’t reproduce the problem and unfortunately i can’t make the project public.

When opening the scene, my hierarchy is not showing.
Instead, there is a single object called “EnableEntity”.
I think this object was somewhere in my hierarchy before, and somehow got moved to root.

There is also an error displayed at the bottom of the screen:

More than one root entities in Scene. Current root is....

The name of the original root object was “Root”
The name of the wrong root object is “EnableEntity”

I can get the entities like this:

var wrongroot ="entities:list").find(element => == "EnableEntity").entity;
var goodroot ="entities:list").find(element => == "Root").entity;

I can see that the hierarchy is still there with the script, but this double root problem prevents me from accessing it.

All my attempts at removing the wrong root object failed.
I assume that when this object can be removed, my scene would work again.

Any ideas?

Hi @HebelHuber,

Calling @yaustar he may be able to look at this from the server/database side with the PC team.

@HebelHuber Can you add yaustar and vaios to the project please? We should be able to rectify it quickly

Okay, just added you guys.

Thanks for the quick help.
Problem scene is called Main

Thanks, while we are sorting this out, do you remember what was the last few things that were done prior to the scene breaking?

This is so we can look at how we can ensure to prevent this from happening again or at least reduce the chances :slight_smile:

There’s a template called “Marker” in the template folder.
I was working on that, doing reparent stuff

1 Like

There was a warning “cannot reparent” or similar.

1 Like

@HebelHuber, I’ve made a checkpoint before I’ve started deleting entities and I’ve got it back to a working state. Can you check the scene to see if it’s okay?

CC’ing @zpaul

Yeah that looks good.

Could you find the problem?
In case this happens again, is there a way i can fix it myself?

1 Like

We will have a look internally to see what could be the cause.

If it does happen again, make a checkpoint so that you can revert if things go wrong.

I had to delete the entities that had a null parent. To do this (and anyone that reads this, does so at their own risk), you can open the dev console and type the following command:'entities:delete', ['entities:get', resourceid)])

Where the resourceid is the GUUID that comes up in the warning message.

However, please do report these issues as they happen because it is very important to use to fix this and find reproducible cases.

Okay, thank you very much for the quick help!

If possible, could you add zpaul to that project also, so I can take a look.

@HebelHuber, @zpaul is part of the PlayCanvas team and has a deep understanding of the Template system :slight_smile:

Okay, I just added @zpaul

I kinda have to keep working on it though.
Would it be possible to clone to your side, so i can keep working?

Yes, that’s not a problem. Our investigation should not interfere with your day to day work :slight_smile:

I’ve also added 10GB to your storage too.

Oh wow, thank you!