- Home /
Handles.DrawPolyLine
Handles.DrawPolyLine
I need to have a line constantly visible in editor and not having to keep selecting the object that has that handle. How do I accomplish that?
For testing I am simply using unity example stated in scripting reference for Handles.DrawPolyLine()
Comment
Answer by Bunny83 · Jun 07, 2012 at 10:19 PM
I didn't try it but it might work when you place it in OnDrawGizmos. Keep in mind to use preprocessor tags to exclude the editor stuff so you can still create a build.
#if UNITY_EDITOR
//editor stuff here
#endif
Otherwise you can't build your game / application. If OnDrawGizmos doesn't work, you might try it in OnGUI's repaint event along with ExecuteInEditMode
Gizmo stuff isn't included in a build anyway, so no need to do preprocessor tags.
Your answer
![](https://koobas.hobune.stream/wayback/20220613072510im_/https://answers.unity.com/themes/thub/images/avi.jpg)