- Home /
Quicky deselect all selected object in Editor
When I'm finished working with object I'd like to deselect it to not make any accidental changes. But it drives me nuts, that such a simple procedure takes extra time. I know 3 ways to deselect a selected objects, but I want to find more faster and simpler method.
Find a sky and click it. Disadvantages: Mostly it takes to much time and changes your working position
Shift + LMB on selected object. Disadvantages: You can click something else and add it to selection and you need to aim at that object which also takes time.
Click on empty space in project section. Disadvantages: The content of opened folder changes, so you still need to aim and if the opened folder is full of assets it getting hard to click at empty space. + My Project tab is on the second monitor, so I need to waste a lot of time on mouse dragging.
I really hope that there is a key combination for deselect or some easyer methods to do this.
Answer by iDeally · Apr 14, 2018 at 07:09 AM
Create a new .cs script in the "Editor" folder. Then put the following code there:
using UnityEngine;
using UnityEditor;
public class EditorShortCutKeys : ScriptableObject
{
[MenuItem("GameObject/Deselect all %#D")]
static void DeselectAll()
{
Selection.objects = new Object[0];
}
}
Now you can press ctrl + shift + d to deselect all. If you wish to change howkey you should edit a "MenuItem" attribute. More info is here: https://docs.unity3d.com/ScriptReference/MenuItem.html
This almost works for iOS. What should i change in this script for "command+shift+D"?
As I see in docs, you should not change anything. It should work with provided example. Does it not?
It "mostly" works. The %# does not translate to control+shift though, so I can't figure out how to make a hotkey for it on mac.
Answer by Acr1m · May 16, 2014 at 09:16 PM
Yeah, this is a really annoying issue because a "Deselect All" command is easily found in most every major software :/
The cleanest and clearest way to deselect things in Unity is by Ctrl+LMB clicking the object in the "Hierarchy Window". (If you double click too fast, it will focus your Scene window on that object, so be careful.)
Another thing you can do is make a new script file and paste in the code found on THIS page. It will put a command in the top menu tabs of Unity, but I don't think it will add a hotkey, so do get too excited :/
Both of the linked scripts attempt to register a hotkey (as described in the $$anonymous$$enuItem documentation). One uses "_a", which is just the A key; the other uses "#a" which is Shift+A.
Answer by maltakereuz · Feb 10, 2018 at 05:37 AM
It's really goes on my nerves, so here my workaround:
Ctrl + Shift + N (in Hierarchy) to create new dummy object
Select it (and only it) with mouse or somehow
Ctrl + Alt + 1 (add it to selection group 1)
Eleminate mercylessy dummy object
Now you can use Ctrl + Shift + 1 to deselect all (technically select nothing or rip dummy more accurate)
not very nice, but better als scrolling out scene to find an empty space to click each time why it can not be just Ctrl + Shift + A? Dear unity dev team...
Answer by KeithGarry · Jan 08 at 03:08 PM
This was added to Unity. Shift+D will now deselect all.
Or Edit -> Deselect All