Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

EventSystem Current Selected Gameobject is null on click?

$
0
0
So I've made a gui button in a canvas and the OnClick() function runs a method in a script to output in the console the current selected gameobject:

Code (CSharp):
  1.     public void AssignHotkeyContent(){
  2.         Debug.Log (eventSys.currentSelectedGameObject);
  3.     }
And eventSys is the Event System object that the canvas is using. Now, I have another canvas (an inventory, if you will) in which you select the items (buttons) and the 'current selected gameobject' IS the item. So it does...

EventSystem Current Selected Gameobject is null on click?

Viewing all articles
Browse latest Browse all 23263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>