The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

+1 vote

I got a main scene where most of my background are populated with touch button nodes. Over the main scene I got a GUI canvas layer with fixed position texture buttons. My main scene can be panned and sometimes the texture_buttons overlaps the touch buttons on the background. When this happens, whenever I click the GUI texture button, the touch button also gets clicked, how can I stop this from happening?

in Engine by (45 points)
edited by

Ugh... that sucks. It's strange to me that TouchButton is not a Control. Perhaps you could raise that problem in the issue tracker? (by providing your example projects so it's easier to have a look)

Edit: actually, TouchScreenButton is not a Control on purpose... https://github.com/godotengine/godot/issues/15039, I'm quite confused about what the signals are for, now

@Zylann, yeah... feeling hopeless about this one now... cant get a good solution even from r/godot and the facebook group... I would probably go the wild and rough way of funneling all func input(event) from top scene down instead of using the basic button pressed signals... THanks for help! :)

You could try putting a Control under your button though, that could do the trick to stop input?

I went ahead and ditched the standard pressed signals and use guiinput for the textureButton and inputevent for the touchButton.
- textureButton overlapping touchButton, textureButton gets input. OK
- textureButton overlapping textureButton, top button gets input. OK
- touchButton overlapping touchButton... both gets input. Not OK but I will not be having this scenario though :P

Hi, perhaps it's a good idea to post your solution as an answer and select it as best if you solved your issue, so other people facing the same problem see it's solved!

1 Answer

0 votes
Best answer

I went ahead and ditched the standard pressed signals and use guiinput for the textureButton and inputevent for the touchButton.
- textureButton overlapping touchButton, textureButton gets input. OK
- textureButton overlapping textureButton, top button gets input. OK
- touchButton overlapping touchButton... both gets input. Not OK but I will not be having this scenario though :P

by (45 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.