Avoiding mouse click to "pass through" Image ?

Hi,

I’m having a problem with images in Widgets.

For example, if you can click drag to move camera in your game.
You add your widget on screen (composed of just an image) What I’d like is that the image blocks the mouse click so you can’t move camera if you click drag on the image.

Maybe that’s how it’s supposed to behave and there’s a little trick to make it work but I don’t get it (I thought that setting it to visible in Visibility will do the job).

The thing it that buttons act like I want, but I don’t want to put all my images in buttons just for that behavior (plus I’m not sure it’s optimized).

I looked on the forum. The only answer I found was this one but I don’t really get the workaround :s :

Try this for the image widget:

1 Like

Hey,

Thanks it’s nearly there :smiley:
In fact, I can still drag camera by clicking the image but only once. If I release the click and try again then I can’t drag anymore.
I tried using Handle on both but it’s the same.

By the way, if I want that to also work on mobile (touch) ; would this be the way to go ?

Does not seem related to the above. Perhaps you change the widget to be less interactive once dragging start - like setting its visibility to be not hit-testable?

If in doubt, do show how the dragging is initiated - especially the bit where Drag Operation is created - that’s the place where one would implement such thing.

work on mobile (touch)

Not my domain. But it’s going to be one of those:

My bet is it’s the last one.