Reputation: 278
Unity had once again left me baffled. When the player's mouse hovers over the UI Image, slot, "Hello" should've been printed out, but it didn't work. I may have just made the most obvious mistake and seem like a total fool, but I have made sure that
Sorry to bother you with such a miniscule error, but thank you in advance for helping me!
Upvotes: 0
Views: 2491
Reputation: 567
For working with Unity 4.6+ UI, include UnityEngine.EventSystem in your script. Add all the IPointer interfaces that you want. Finally, make sure your UI item with the script has either an image or a collider added to it. If you go the collider route, add a physics2draycaster component to your camera.
See the link below:
http://docs.unity3d.com/Manual/SupportedEvents.html
Upvotes: 2