GUI.Image.onPointerDownObservable fires only once

Apology if this is an expected behaviour and I’m misunderstanding the observable.

But when I try to listen to PointerDown on a GUI.Image, the listener is only called the first time I click. Why is that ?

Playground desmontration is here (on line 40)

What bugs me is that if you toggle the device toolbar in the dev tools, and pick any device with touch screen event, the listener is working completely fine.

Somebody a clue ? I’m in a situation where even a workaround would be very welcome.

That is not the expected behavior. @msDestiny14 , care to check?

1 Like

Set image.isPointerBlocker = true;

Have to do it for certain gui controls.

4 Likes

Thanks, that was an easy fix ! :slight_smile:
Was it a real bug after all ? Or should we add a line in the doc to adress this case ?

I think I’ll end up using GUI.Button.CreateImageOnlyButton() though, it suits my case better.

It’s not a bug it’s just a fun fact about the control. I think we could probably put better documentation on this to be honest. This was something that tripped me up when I was first working on the GUI editor. :slight_smile:

The only thing is I don’t 100% remember the reason why it is needed, so writing it in the documentation + an explanation along side it would be the best thing to do.

3 Likes

Is it possible to change this behavior? The listener only getting called on the first click seems a bit strange.

1 Like

I don’t think I would be too difficult to look into, but then you have to think of backwards compatibility.

1 Like

If there is a good reason to keep it this way, then there is no need to change the behavior. Otherwise we can look at it as a bug that needs squashing.

1 Like

Reason is performance mostly (furthermore if your image has alpha)

1 Like