1 (edited by negruj0w1tsch 2021-04-12 09:51:06)

Topic: Unity UI prevents scrolling the camera


Edit: Already found a solution!

Old Question:
In my project I've got some Unity UI elements like UI buttons. When starting a touch on such a button the map does not scroll. I know this is probably the required behaviour for many projects, but in my project I would actually like the camera to move regardless of whether the touch started on a button or on the map. Do you have any quick idea on how to make the map scroll but at the same time allow the button to work on click?

I implemented the IPointerDownHandler interface on the UI elements where I want the map to scroll and in the IPointerDownHandler method I invoked:
OnlineMapsControlBase.instance.isMapDrag = true;
That did the trick!



Re: Unity UI prevents scrolling the camera


Or you can just use Online Maps / Troubleshooting / Not Interact Under GUI - OFF.

Kind Regards,
Infinity Code Team.

uContext is Editor PowerPack (more than 40 tools) that take your workflow in Unity Editor to a next level, simplifies working with content, adds new features, corrects and improves the editor’s built-in behaviors. Click here to download uContext Basic for free.