Touch object but not when dragging camera


I’m using the DragCameraWithPointer extension to allow me to scroll horizontally on a layer. This layer has clickable objects. Initially when dragging and the touch/cursor touched an object, that object changed scene. I only want this when the camera is not moving/being dragged.

I’ve tried this:

But now it does not trigger the touch event, as I am assuming that any touch events triggers the camera drag action thus also setting scroll = 1.

I’ve tried moving the events in different order to no luck. Has anyone done this, or can guide/point me to a way in fixing my “code”?


Any ideas with this? Surely it’s just a simple fix?

If you use a button object or this behavior:
you can check if no button is pressed.

Thanks, it has helped a bit. There are still instances where it confused dragging the camera to a button press to change level - but it’s better than it was. I’ll still tweak it until I get it right, I might just have to resort to a next/previous buttons instead of dragging.

Maybe you can use a timer to figure out how much time had passed since that “touch” begun till it’s release, if it’s something like 0.5 seconds or less then it’s a tap and it triggers the button, if it’s more than that then it don’t triggers the button and it just drag the camera.

Many apps and games works like this on mobile.