- Home /
How to handle GhostObjects(Not appear in heirarchy, not selectable)?
I encountered a strange behavior in a Scene, it has a GhostObject(Yes it is a Ghost, I deleted everything in Heirachy!). Its a Prefab created by me, just a simple Mesh with a Collider, no Scripts, nothing fancy. The Prefab is not visible in Heirachy, but Objects can collide with its Collider and I can Print out its Name.
It is the same like described here in this answer
When I use the HiddenObjectExplorer.cs from this answer I can see my Prefab that is still in the Scene. But you can not delete it in this window, if the delete button is pressed it says "destroying assets is not permitted to avoid data loss" in Console. And an other strange thing is that the Object is not marked as HideInHierarchy.
So how can I delete this Prefab from my Scene, not from my Project, or better how can I make the Object return to become visible in the Heirachy?
Thanks GameGuy
Answer by DanVioletSagmiller · May 31, 2018 at 02:43 PM
I've run into similar issues with Ghost objects and Ghost components or values in components. The issue was with mal-formed scenes. In my case it happened because I had a merge go wrong on Collaborate. (was using winmerge to try dealing with some of the issues.)
Unfortunately, the only solution was to step back several versions. (it was not noticed until a week later, and had several edits on top later)
Something you could try, is add an object, with a custom script, that basically uses the "FindObjects" methods to list everything in the scene. After that, you can modify it with an if statement that if it finds X (listed the first time you ran it) that it would delete that object.
Thanks for your help, have you any clue what can cause these GhostObjects beside merge Operations? Because I have not useded Editor Flags nor $$anonymous$$erged something?