#GUI button cannot be clicked

1 messages · Page 1 of 1 (latest)

keen echo
#

I have a 3D tablet that uses a sub view port to display a 2D menu on it. There's a texture button I've added for the "scramble" function but when playing the game it can't be clicked.

I've checked every control, every color rect, to make sure under Mouse > Filter it is set to pass.

In the debugger nothing is coming up next to clicked control or clicked control type.

In the subviewport GUI settings "Disable input" is not enabled.

I'm really stumped on this one. Every solution I've found involves adjusting the Mouse > Filter setting but I've checked them all 😦

silent pecan
#

Not sure why it's not working but you could try using on_gui_input (with a check that the event is LMB pressed) instead of the buttons pressed signal

keen echo
#

I did try that earlier but if you tap left click it turn runs a function multiple times really quick.

For context all this button does it show a color rect and play a noise when pressed. When pressed again it stops the noise and hides the colorect.

Left clicking would show and hide it multiple times really fast even with one quick click. I think adjusting the dead zone can help

silent pecan
#

Use event.is_just_pressed instead of is_pressed

keen echo
#

Thought I was on to something I'm going try your idea 😄

silent pecan
#

You have the print outside of the if

keen echo
#

This was commented out during that video what the hell Godot

#

Okay for some reason the function there won't work but now the button is?

But only if your mouse is on a very specefic set of pixels?

silent pecan
#

My guess is that specific set of pixels is the original location of the button, before you applied the shaders or whatever, no idea how to fix that though