I've been working with UI in my project as of late and I can't figure out what Unity's event system is supposed to return for currentSelectedGameObject
.
if (EventSystem.current.currentSelectedGameObject != null)
{
Debug.Log(EventSystem.current.currentSelectedGameObject.name);
}
With the code above I figured that it should return something when I'm moving the mouse across the various UI elements. Unity's documentation appears to be poor on this function stating:
The GameObject currently considered active by the
EventSystem
.
maybe I'm just being stupid but does anyone know what triggers currentSelectedGameObject
?