- Home /
Handles.DrawLine delayed
Currently I'm writing some Editor script and everything was fine until I've tried to create a line between selected node in my graph and mouse position Basically code checks if the mouse is over any node and if user selects it and draws a line between the node and mousePosition
And now comes the issue. Everything is fine until I'm in range of the node, when the mouse is outside of it has to stop in one place for some time to draw line properly and when the mouse is moving line just freezes. Mouse position detection works fine. Any ideas?
It's not because of the framerate. Debug.Log(secondPoint) works dine and has different values every frame when moving
Answer by PhoXinuS · Jan 12, 2021 at 01:11 PM
Okay, I think I've found the issue. for obvious reasons scene view doesn't refresh itself frequently enough to spare the resources for other background tasks so that is the cause of that weird "snapping" after mouse Everything you have to do is put command below at the end of OnSceneGUI( );
HandleUtility.Repaint( );
Have a nice day ♥
Your answer
Follow this Question
Related Questions
Is it possible to determine wich Handles.PositionHandle is currently focused? 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Z sorting of Handles 0 Answers
Save Components setting for reuse 1 Answer