• 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
0
Question by sportsfan78 · Jan 05, 2014 at 07:41 AM · inspectorhotkeys

Hotkeys to move components up/down in Inspector?

Are there hotkeys to move components up and down in the inspector? I find it very time consuming to have to repeatedly right click and "move up" or "move down".

I could have sworn I saw a hotkey for this in one tutorial or another, but I can't seem to find it again. I keep finding the similar lists of hotkeys that don't seem to include it. Most of the other questions on the subject seem fairly old, and seem like they are referring to a time when one could not rearrange the order of components.

Comment
Add comment · Show 1
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 vexe · Jul 24, 2015 at 11:03 AM 0
Share

Just use $$anonymous$$oveComponentUp and $$anonymous$$oveComponentDown in UnityEditorInternal.ComponentUtility

5 Replies

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

Answer by xeleh · Jul 24, 2015 at 10:46 AM

Now it's possible. XT Reorder supports reordering the components in the Inspector with hotkeys.

http://u3d.as/content/xeleh-tools/xt-reorder

Comment
Add comment · Show 2 · 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 idbrii · May 17, 2018 at 05:00 PM 0
Share

Unfortunately, XT Reorder is no longer available.

This package has been deprecated from the Asset Store.
avatar image _xeleh_ idbrii · May 17, 2018 at 05:08 PM 0
Share

Yes, it was deprecated because starting in Unity 5.6 you don't need an additional utility for component reordering. $$anonymous$$ore information: https://forum.unity.com/threads/deprecated-xt-reorder-drag-drop-in-the-inspector.417572/#post-3090915

avatar image
0

Answer by kilogold · Oct 03, 2014 at 06:14 PM

As of this moment, Unity has not implemented such mechanics. There may hotkeys for other similar actions, but as for reordering the components, the closest you'll be be able to get is this:

http://u3d.as/content/man-on-edge/component-reorder/2Zb

Hope this helps!

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
0

Answer by Cobo3 · Jun 21, 2016 at 09:29 PM

This plugin does exactly that in the most possible intuitive way

http://forum.unity3d.com/threads/released-component-tool-panel-compact-seamlessly-intergated-component-utils.404588/

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
0

Answer by RussClarke · Jul 25, 2016 at 04:14 PM

FYI although there isn't a builtin hotkey, you can add and reorder components as a multi-edit operation, which makes all the difference if you have to do this for several objects at once.

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
0

Answer by idbrii · May 17, 2018 at 05:37 PM

You can use MenuItem and the undocumented UnityEditorInternal.ComponentUtility.MoveComponentUp/Down to make your own hotkeys.

For example to create a menu with hotkey shift-alt-u use something like:

 [MenuItem("MyMenu/Component Up #&u")]
 static void MoveUp()
 {
     var sel = Selection.activeGameObject;
     var target_component = sel.GetComponent<MoveThisKindOfComponent>();
     UnityEditorInternal.ComponentUtility.MoveComponentUp(target_component);
 }

But as far as I know, Unity doesn't have a concept of currently selected component, so you'd have to find some way to specify which component type to move. If you made an Editor, you could have an ObjectField :

 m_ComponentType = EditorGUILayout.ObjectField("Move Component:", m_ComponentType, typeof(MonoScript), allowSceneObjects: false) as MonoScript;
 var target_component = sel.GetComponent(m_ComponentType.GetClass());

That editor might be a good place for your MenuItem to live.

Comment
Add comment · Show 1 · 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 _xeleh_ · May 17, 2018 at 05:57 PM 0
Share

This question only made sense when there was not built-in drag and drop reordering of components. You already exposed the reason: as there's not really a concept of currently selected component, the kind of support you can implement for this is quite limited. The best I could implement in XT Reorder was a pair of hotkeys for moving all components up or down, with a rotation of the first and last component. Not a perfect solution, but combined with the drag and drop it was good enough for many situations.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

25 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 avatar image avatar image avatar image

Related Questions

White object preview for all prefabs 1 Answer

_a / _b /_c ...etc.. is supposed to set a hotkey as "a,b,c" but doesn't? 0 Answers

Problems with Ctrl hotkeys 1 Answer

How does one inspect static vars? 3 Answers

Editor: multiple Inspectors 3 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges