- Home /
Handles Mouse Event Drag not working
Hi, i have an EditorScript, with PositionHandles. Now if I want to detect this:
if(Event.current.type == EventType.MouseDrag) { // do Something... }
It works if I just hold down the MouseButton and Drag around in SceneView(OnSceneGUI), but it doesn't detect any Event if I move the PositionHandle.
Could not find anything Related to Handles on the Web.. might someone has wisdom about that?
thanks Dan
Answer by Bunny83 · Feb 11, 2019 at 04:59 PM
I think your issue is "where" you actually check that event. Keep in mind that the IMGUI event system is an immediate mode system. Each control that is processed has the opportunity to react or eat the event. Once a control has "eaten" / used (e.Use()) an event it will turn into EventType.Used for all following controls.
So you may just need to put your code above your handles. In some cases you could also try reading the undocumented "rawType" property of the Event class which should still hold the actual event type even some control has used it already.
the rawtype i’ve tried, but without success.
thanks anyway i’ll try that out, setting a boolean above all onscenegui methods
Your answer
Follow this Question
Related Questions
Steal keyboard event Alpha0-9 and disable Unity editor hotkey in custom editor script 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
2d mode through Editor Script 1 Answer
What is a better way to check if an object is a project asset, but not a folder in the editor? 0 Answers