Hey friends,
There is a shortcut ‘Z’, which allows to scale from pivot/center of object.
However, there is no key to change between local/global move/rotate/scale mode.
…Well, here is a script which allows to do just that ![]()
Place it into an “Assets/Editor/” folder, naming the script as “GlobalLocalSpace_ShortcutTool”
using UnityEngine;
using UnityEditor;
//allows to switch between global-local space, in editor with the 'Tab' key.
//Place in the "Assets/Editor" folder.
// Igor Aherne, 14th August 2017 www.facebook.com/igor.aherne
[InitializeOnLoad]
public static class GlobalLocalSpace_ShortcutTool {
static bool currPressingSpace = false;
static bool currDraggingLeftMouse = false;
static bool currDraggingRightMouse = false;
static Event _currEvent;
static GlobalLocalSpace_ShortcutTool() {
SceneView.onSceneGUIDelegate -= OnSceneView;
SceneView.onSceneGUIDelegate += OnSceneView;
}
static void OnSceneView(SceneView sv) {
_currEvent = Event.current;
if (_currEvent.isKey == false) {
return;
}
if (_currEvent.keyCode != KeyCode.Tab) {
return;
}
if (_currEvent.type != EventType.KeyDown) {
return;
}
//cycle between world & local spaces:.
var differentMode = Tools.pivotRotation == PivotRotation.Global ? PivotRotation.Local : PivotRotation.Global;
Tools.pivotRotation = differentMode;
}
}