Question by
MattSawrey · Nov 11, 2015 at 08:05 PM ·
guieditoronsceneguihotcontrol
GUIUtility.hotControl = 0 does not deselect scene object
I'm using GUIUtility.hotControl in an OnSceneGUI() to detect mouse drags. I'm setting GUIUtility.hotControl to 0 when the mousebutton is lifted but the object that has been selected isn't being deselected.
How do I deselect the object in question after I've modified GUI.hotControl?
Comment
Answer by MattSawrey · Nov 11, 2015 at 09:25 PM
Figured out that I can solve this by simply setting:
Selection.activeGameObject = null;
When the conditions i specify for deselection are met.
Your answer
![](https://koobas.hobune.stream/wayback/20220612044742im_/https://answers.unity.com/themes/thub/images/avi.jpg)