Is there a keyboard shortcut for setting an object active/inactive?

While I’m browsing the Hierarchy using the keyboard, is there a shortcut to toggle active on the selected object, or am I forced to click the inspector using the mouse?

There is a menu item for this now. GameObject → Toggle Active State, with shortcut Alt-Shift-A

Toggle Active/Inactive state of any selected Game object in Unity Hierarchy use Alt + Shift + A. Its working in Unity Version 2018.3.0f2.

There are no shortcuts that I know of. However,
Similar to Customize shortcuts in the unity-editor, you can create a menu item with a shortcut that does this for you.

Create a folder called Editor and inside of it, create a c# script and name it MyShortcuts.cs and paste this in:

using UnityEditor;
using UnityEngine;

public class MyShortcuts : Editor
{
  [MenuItem("GameObject/ActiveToggle _a")]
  static void ToggleActivationSelection()
  {
    var go = Selection.activeGameObject;
    go.SetActive(!go.activeSelf);
  }
}

Now whenever you select an object if you press “a”, it activates/deactivates it. Note that the caps lock should be on. I couldn’t figure out why it needs it to be caps lock, but it does work :slight_smile:

I hope this answers your question.

@Lohoris2 I‘m not sure, but I guess you can use 3 on the keyboard once you selected an object to toggle the active state. Worked on some previous versions as well