Sprite stuck in scene view but not visible in hierarchy
So I'm quite new at using unity, and I was dragging a sprite from my assets into the scene view. While doing it, I accidentally pressed alt, with the result that I made 2 copies of the sprite -one when I pressed alt and the second when I released it-. Now I'm trying everything but I can't delete them, I also tried to restart unity with no result. Undo doesn't delete them, they are not visible in hierarchy and I also cannot select them. Does anyone know how to help me?
Answer by hale326 · May 07, 2016 at 09:24 AM
I finally solved the problem in the only way I could. So for everyone that may have the same problem in the future, I simply copied everything in the hierarchy, created a new scene and pasted everything there. That's it. The "impossible sprites" are gone in the new scene, so it must be some kind of bug the fact that for unity, they seem to not exsist. A little note for everyone: for now, NEVER drag an asset in the scene view while pressing alt if you don't want your asset to be stuck there for a long time. "Undo" doesn't solve the problem, you have to close the project without saving to go back.
Anyway, thanks to everyone that tried to help me.
Answer by mbalestrini · Jan 18, 2017 at 02:25 PM
This worked for me:
Select the sprite by doing Ctrl+a (the only way for me to be able to select it) and then Ctrl+click every object in the hierarchy to deselect it, then hit delete on your keyboard.
Thanks! We can be make it a bit easier:
Ctrl+A to select all objects in the hierarchy
Ctrl+C to copy
Delete to delete all objects
Ctrl+P to paste everything (else) back
Worked for me.
Yeah, that's easier! But I don't know why I'm afraid that if I delete and paste everything back something might not be exactly the same :)
You can select all items in the hierarchy by clicking the top most, holding shift and clicking the bottom most item. You can deselect them all in one click in the inspector this way
Answer by easyBoy · Mar 17, 2017 at 02:24 AM
Better way to this
Ctrl + A to select all the objects in the hierarchy
Suppr to delete them all.
Ctrl + Z to restore all the objects: the problematic object will not appear anymore
Answer by slake_it · Nov 06, 2016 at 02:21 AM
I've created a simple editor menu method to select the game object, then you can simply hit the delete button on the keyboard & it will be gone.
NOTES
put the method in any class
change the name variable to your stuck game object name
copy the name from the hierarchy not the project view ( the encoding seems to be different for some reason)
go to MyMenu - > select object by name - > hit delete
[MenuItem("My Menu/Select By Name")] public static void SelectByName() { string name = "my stuck object name"; GameObject myObject = GameObject.Find(name); Selection.activeGameObject = myObject; }
Answer by TobyKaos · May 02, 2016 at 12:01 PM
Try to reimport the scene on the project folder.
Yes, I already tried that, it's not a big project so it didn't take too long, but the situation didn't change