- Home /
Can't Select GameObjects Under UI In Scene View
I have a bunch of sprites and a UI panel to provide a background color. In the scene view, I can't select the sprites because the focus always goes to the UI panel. This is true regardless of sorting laye, regardless of Z position, and regardless of order in the hierarchy. How can I give selection priority to the game objects I care about?
Answer by instruct9r · Jul 09, 2015 at 11:27 PM
UI allways have a bigger priority in the Scene view. Go to Layers and deactivate the UI, if you want to work on the scene objects.
Bleh. Seems like a pretty big pain the butt to me! I wonder if there's custom selection code you could write to ignore certain layers.
Not that i know. If somebody else, knows another way of ignoring the UI...
Try this:- $$anonymous$$ake an empty gameobject, make your canvas the child of that gameobject. $$anonymous$$ove the gameobject somewhere out the way in your scene. Add a script to the gameobject that simply sets its position back to 0,0,0 so when you run it is in the correct place.
The problem I'm having is specifically selecting objects during play mode. All of my stuff (game objects, UI, etc.) is instantiated when I hit play.
Yeah, that's probably the best solution. Thanks. If you want to mark it as a separate answer, I'd be happy to give credit to that one as it doesn't require turning off UI visibility in the editor.
Answer by Thorny2000 · Jul 11, 2015 at 12:19 AM
OK, do what I said before to move the UI in the scene (parent it with an object and move it). Now add a second camera and make that the GUI camera (use the culling mask setting on both your cameras - one is game, one is UI).
Now your GUI should be somewhere way off in a corner and you can edit in the scene without clicking it.
Answer by _geo__ · Jun 20, 2019 at 10:37 AM
I know it's a fairly old question but this has been bugging me and my colleagues for ages too. To solve it we have created a plugin which modifies the selection in the scene view. It can ignore ui elements by name (transparent ui elements are click-through by default).
In the image below you can see how to ignore a specific element. I have named it "ui-panel-background" as a reference to @eshan-mathur s original question.
Link to "Smart Ui Selection": https://assetstore.unity.com/packages/tools/gui/smart-ui-selection-unity-editor-124328
@mods: I know it's an old question and that it might be considered a "plug" but I think it provides a not yet given solution to eshan-mathurs problem and may be beneficial for all readers. If you deem it unworthy as an answer, just remove it, no hard feelings :-)
Answer by Xarbrough · Sep 28, 2020 at 04:12 PM
After a few years of experimentation, the solution my team settled on was a context popup that displays a list of GameObjects under the mouse in the scene view. This is similar to the way Photoshop, Blender, and other graphic software handle overlapping elements. To implement this yourself, you can use Unity's API HandleUtility.PickGameObject. But I'm also maintaining a supported version myself: https://assetstore.unity.com/packages/slug/179537
Your answer
Follow this Question
Related Questions
Scene View - Click selects wrong object?! 4 Answers
Access Scene View Selection Rectangle 0 Answers
Selecting custom game objects in Scene view window. 1 Answer
How can I get info on object in scene view without selecting it? 0 Answers
Character Selection 0 Answers