- Home /
What is the best way to use the Handles class to create custom gizmos.
I want to extend the editor to use gizmos to manipulte some of the properties of my game object.
I have a PhysicsZone that modifies the properties of the game character when inside of it. This zone has for example a gravity direction. I want to allow the level designer to use a rotation handle to rotate the Vector3 property for the gravity.
I have created an editor class and tried multiple methods including extending the OnSceneGUI and creating my own static function that draws gizmos.
While I have had some success in drawing and handling input to manipulate the property, it has all been trial and error. There are some problems that I can not figure out. Does anyone know of the most efficient and surefire way to do this?
Specifically use the Handles class and rotation handle to modify the value of the selected components Vector3 property?
Thank you
Are you making sure to convert the rotation quaternion to/from euler angles?
Where's exactly your problem? Like $$anonymous$$ax said you have to convert your Vector3 into a Quaternion to use a RotationHandle and convert it back to your Vector3. The Handles work similar to the GUI stuff. The difference is just that you have to specify a 3D point in space where your handle should be displayed. I've written a little tool for BoxColliders, maybe that helps ;) http://www.unifycommunity.com/wiki/index.php?title=BoxColliderUtilities
Answer by DaveA · Jan 29, 2011 at 05:46 AM
Have you looked at this? : http://answers.unity3d.com/questions/5275/how-to-create-handles-like-editor-gizmos-in-runtime
Your answer
Follow this Question
Related Questions
Editor Windows : Help required 1 Answer
Showing Handles in the Game View 1 Answer
Select object by selecting gizmo or handle? 1 Answer
3d Line Drawing in editor with z-sorting 2 Answers
Editor 3D tools with depth 1 Answer