|
|
|
 |
Reply From: |
LoneDespair |
you could bound your input for shooting and gameplay to _unhandled_input(event):
which would block inputs that happens on gui’s that filters mouse
but that option adds a LOT of latency, which could be an issue for your game
-as a work around you could have a canvas layer with its layer lower than all of your gui
-add a child control node
-connect its signal for mouse enter and exit for enabling and disabling your mouse inputs for your gameplay
-make sure to set it to full rect on layout
-whenever the mouse enters your control node it means that its not being blocked by a gui, else there is a gui on top
its a clunky solution but it gets the job done, you could even use singletons for this
I’m having a new issue while trying to implement the _unhandled_input
method you were describing. popup()
isn’t getting called when putting it in a _input
function:
func _input(event):
if event.is_action_pressed("menu"):
print("pre-popup")
popup()
print("post-popup")
These print statements are working, it’s just popup()
isn’t. The weird thing is, popup()
works when it’s in _process
function, so I don’t know what that’s about.
PopeRigby | 2020-05-24 19:52
it works for me, maybe test it on its own scene? to make sure nothing else is interfering
or try other inputs to debug if which is the problem eg “ui_up”
as for the unhandled_input
it will not detect inputs that are being registered/detected by a gui
most gui registers mouse inputs by default
LoneDespair | 2020-05-25 16:42