Way to set control focus to nothing?

I am looking for a way, after setting a GUI Control (lets say a button) to be the focused control, to then set the focused control to nothing so the button un-focuses itself.

I have tried:-
GUI.FocusControl(“”);

But that doesn’t work.

Any ideas?

Not a very elegant solution, but would it be possible to create an extra “invisible” control offscreen? Then, you could set the focus to that whenever you wanted all the real controls unfocused.

Just at the end of your GUI function type GUI.SetNextControlName(“”); Then whenever you want to defocus, you can simply do FocusControl(“”). I’ve not seen any bugs with this so far and Unity doesn’t mind it, so seems to work great for me.

1 Like

work like a charm Spectre9000, thanks!