rotation | Orientation of the handle. |
position | Center of the handle in 3D space. |
Make a Scene view rotation handle.
//Create a rotation handle at (0,0,0) and rotate any object that has "RotateAtPoint.js" // attached from 0,0,0. @CustomEditor (RotateAtPoint) class RotationHandleJS extends Editor { function OnSceneGUI () { target.rot = Handles.RotationHandle (target.rot, Vector3.zero); if (GUI.changed) EditorUtility.SetDirty (target); } }
// RotateAtPoint.js // This Script has to be outside of the editor folder. // // Usage: Just Place this script on the object you want to work the handle with. // And control the Object's rotation from the handle that appears at 0,0,0 when // This object is selected. @script ExecuteInEditMode() var rot : Quaternion = Quaternion.identity; function Update () { transform.rotation = rot; }