- Home /
How can I get rid of this element?
Hi, I don't know what this is and how to delete it. This gameobject (or whatever it is) can't be found in hierarchy.
Even though this object doesn't interact with any other objects and doesn't affect game anyhow, it really annoys me.
Hi. I have this thing as well, i think it's a glitch or something. But it is totally harmless and doesn't appear on the game view, you can only see it on the scene view.
Yeah, I know, but it still irritates me :(. Thanks for reply anyway.
Are you talking about the purple box with a bit of a red X over it? That shows up in the scene view when an invalid transform is created. It can be due to a negative scale, or trying to get an object with a particular size into a container that can't display the entire thing. At least that's been my experience. It can be difficult to figure out why that shows up, since I'm sure those two cases aren't the only possible ones.
it can be a game object in the hierarchy with empty name (impossible to see) or some script with this flag [ExecuteInEdit$$anonymous$$ode] creating it ?
it's up to you, you need to inspect all codes that contains [ExecuteInEdit$$anonymous$$ode] or HideInHierarchy flags and try to select those objects in the hirachy.
Can you search your code for HideInHierarchy? https://docs.unity3d.com/ScriptReference/HideFlags.HideInHierarchy.html
Answer by Bunny83 · Oct 05, 2017 at 11:02 AM
It could be a Gizmo that is drawn by one of the scripts you have in the scene. Check the Gizmos menu above your SceneView:
If there are no classes with an OnDrawGizmo method or if deactivating doesn't help:
Try using the editor script i've posted over here. Be careful as it reveals even built-in hidden objects which you shouldn't touch or delete. If you do the Unity editor might get unusable and you may have to force quit. Though everything will be back to normal when you restart the editor.
If you can't find any object in the scene, it might be a custom inspector or other editor script which hooked into the OnSceneView delegate to manually draw that thing. This is a bit difficult to figure out. Try searching through your whole project for the text SceneView.onSceneGUIDelegate
. If you found something it might be the reason for the image.
If you can't find that text anywhere in your project, you may have imported third party editor assemblies (DLLs) which contain the code that is drawing this image.
From this point on it's getting really difficult to help any further.
If nothing helped so far, before answering back you should narrow down the problem:
Does it still exist when you open a new empty scene?
Does it still exist when you create a new empty project?
If it's gone when you open a new scene it has to be something in the last open scene.
If it's gone when you create a new project it might be something in your project (editor script)
If it's still there it might be some strange kind of Unity editor extension.