- Home /
Scale the standard Transform Handle
Hi, I was just wondering if there's a way to scale the standard transform handle? (Used for moving object in the editor scene view.) I'm making an editor script with multiple handles and they tend to get somewhat in the way of each other.
Answer by Bunny83 · Oct 17, 2017 at 11:15 AM
In short: No, the size of the PositionHandle can't really be changed as the handle size is calculated directly inside the internal code.
However it's common when you create your own "tool" to simply "disable" the default tools / switch to your custom tool by setting it to Tool.None.
Answer by PROE_ · Apr 29, 2020 at 04:17 PM
You can scale handles from the Handles class using matrix transformation. EDIT: you can't scale the main Transform tools, only your own. Example:
var startMatrix = Handles.matrix;
bc.BezierCurve.StartPoint = Handles.PositionHandle(bc.transform.position, Quaternion.identity);
bc.BezierCurve.EndPoint = Handles.PositionHandle(bc.BezierCurve.EndPoint, Quaternion.identity);
// Q1 & Q2
Handles.matrix = Matrix4x4.Scale(Vector3.one / 2) * startMatrix;
bc.BezierCurve.Q1 = Handles.PositionHandle(bc.BezierCurve.Q1 * 2, Quaternion.identity) / 2;
bc.BezierCurve.Q2 = Handles.PositionHandle(bc.BezierCurve.Q2 * 2, Quaternion.identity) / 2;
Handles.matrix = startMatrix;
The result looks like this:
Your answer
Follow this Question
Related Questions
Transform override 3 Answers
Drawing Handles 1 Answer
Represent a AnimationCurve smoothly with Handles.Bezier 0 Answers
Size To Grid with Walls 0 Answers
Lock Object Position In Editor 1 Answer