Simple test, while trying to work on an inventory system. I wanted to right click on an object in the screen and add it to my inventory, but low and behold when I try to right click on something… NOTHING HAPPENS
So I built a test application… testing left, middle and right clicks… I found out… Unity no longer registers Middle and Right clicks. (nor does it register Fire2 and Fire3)
Whats up with this, is this a bug, or a feature that they added to jerk people around?
You sure you are not just missing the blip of the text changing?
The code you pasted will set the text correctly for the frame when you press the button down while hovered over the collider of the game object to which the script is attached. If miss the collider, the text will not be updated and the frame after the one where the text was set, it will be reset again.
Functionally that is different though as you did not include the raycast check against the collider. This gives you mouse down and up calls regardless of where the mouse was at the time of the interaction.
Oh, sorry, you are correct, I would use OnMouseOver if I was dealing with an object event, but in dealing with an inventory event, which really doesn’t have an object, I would use Update.
I think that those messages should really be deprecated. You’ll be in a much better position if you write your own raycaster. For example IOS doesnt support the OnMouse* messages and ultimately you really do not get alot of info about the click otherwise.