Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
24
Question by Lohoris2 · Oct 30, 2013 at 09:58 AM · hierarchyactivekeyboard shortcut

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?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
55
Best Answer

Answer by elliselkins · Apr 17, 2015 at 12:34 AM

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

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image OnlyFails · May 29, 2016 at 11:10 AM 0
Share

Not sure when they removed this but you can no longer use the Alt+Shift+A hotkey anymore.

avatar image fafase OnlyFails · May 29, 2016 at 11:18 AM 0
Share

It is still there. Check in $$anonymous$$enu - GameObject, it shows as last of the drop down. You need an object to be selected for the item to be used.

avatar image OnlyFails fafase · May 30, 2016 at 07:33 PM 0
Share

I was talking about the keyboard shortcut for setting an object active/inactive. It's still missing from the latest builds.

avatar image Owen-Reynolds OnlyFails · May 30, 2016 at 08:11 PM 0
Share

I'm running 5.2.1 and Alt-shift-A works there.

Just to be clear, this is Edit $$anonymous$$ode, object selected in Hierarchy, then use the key shortcut; toggles the "active" box on/off. It sounds maybe like you're talking about some other use ... ?

avatar image Aram-Azhari Owen-Reynolds · May 30, 2016 at 08:14 PM 0
Share

It works on Play $$anonymous$$ode too, just tried it.

Show more comments
avatar image
4

Answer by junedmmn · Feb 20, 2019 at 03:17 PM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
3

Answer by Aram-Azhari · Oct 30, 2013 at 10:20 AM

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 :)

I hope this answers your question.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meejabych · Mar 06, 2015 at 12:44 PM 1
Share

Thanks for this Aram. A useful modification is to toggle the state of all selected objects, replacing lines 9 and 10 with:

 foreach(GameObject go in Selection.gameObjects)
     go.SetActive(!go.activeSelf);
avatar image NIMBLE_JIM · May 03, 2015 at 09:59 AM 0
Share

This works brilliantly, thanks a lot! Just a note to others, the Editor folder can just be placed in the Assets folder (there will probably already be one there, there was for me).

avatar image OnlyFails · May 30, 2016 at 07:35 PM 0
Share

When I'm typing text into the Text UI component in Unity the 'A' key gets consumed now and I have to edit this script every time I want to type the letter 'a' somewhere.

avatar image Aram-Azhari OnlyFails · May 30, 2016 at 07:40 PM 1
Share

I tried using elliselkins's method and it works for me. Although I've only tested it on $$anonymous$$ac (using Right-Option + Right-Shift + a).

You can modify the _a part in line 6 of my code to something else that isn't used. Refer to $$anonymous$$enuItem on how to modify that to your liking.

avatar image
0

Answer by bignk05 · Mar 29, 2021 at 07:35 PM

@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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Check if game object is active in hierarchy from a prefab 2 Answers

A GameObject That's Not Active In The Hierarchy Still Calling Its Start Method? 1 Answer

GameObject active but nowhere to be found (not even in hierarchy)? 0 Answers

Unity hierarchy not loading and flashes around. 0 Answers

NavMesh and WaveSpawner dont work together! 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges