I have a button with an Event Trigger - PointerClick. Here’s what I’m trying to do:
print(EventSystem.current.currentSelectedGameObject.name);
However, it’s giving me a “NullReferenceException: Object reference not set to an instance of an object” error.
I’m simply trying to determine the name of the object which was clicked. I don’t want to have to create 60+ individual functions for each button - I should be able to get the object name, and then process based on that.
Help!!