The question is answered, right answer was accepted
is there a way to detect OnMouseDown on a UI image?
I've been having truble figuring this out, i thogth it was matter of adding a collider to the object that has the image and the script with the OnMouseDown method but it doesn't work, does it has something to do with the canvas?, because when i do it in a normal gameObject with a sprite works perfectly, but with the object inside the canvas that has an image doesn't work, what am i douing wrong?, many thanks!
Answer by Reaper1121 · Sep 25, 2015 at 06:31 AM
Well there is a way but i would recommend you to attach Button to the UI Image, If you need more explanation tell me :).
it works the same way as On$$anonymous$$ouseDown the only difference is that its using eventsystem.
Answer by Orion390 · Sep 26, 2015 at 12:20 AM
I understand, but then it's not the way to do what i want, which is to have an "interactive" Hud over the 3d enviroment, i already went the right way by using two cameras, thanks for the suggestion!
You could resize canvas and then add a collider to the UI Element and then use On$$anonymous$$ouseDown.