I’m detecting clicks on an ui button but I ran into an issue where it detects alla clicks, not only left mouse button. So even when I press the button I use to go ‘Back’ in my browser, this event fires if I’m hovering above the button.
Follow up reflection: I’ve been using a “shapePicker”-script throughout my app to detect hits via raycast and a bunch of boundingsphere on mouse clicks.
It has worked fine, but just out of your experience - would there be any benefits of using this “UI button in world space” approach instead? I suppose on difference is that I have react to hover events and change the mouse pointer which I suppose I can’t do using my current setup because the raycasts aren’t happening until I actually do a mouse click.
I suppose the shape you mention, the difference would be that with entity picking I could have a 3D shape where as with ui elements only a 2D shape allthough in 3D world space.
It’s not a massive one unless you have hundreds/thousands. Both do some raycasting of some sort. If think the sphere in shape picker is a bit faster as it doesn’t have to handle matrix math calculations.
Ok, good to know. I just figured, since the shapepicker on only raycast on mouse click events, where are in order to do detec hovering the other path must raycast much more often no?