|Topic was automatically imported from the old Question2Answer platform.
I am attempting to code for touchscreen input; there are two different ways that I am processing input.
I created two different scripts to attach to control nodes; one processes the input in one way, and the other script processes the input in a second way. As an example, a mouse click might print “A” to the output in the script one, and a mouse click might print “B” to the output in script two.
I can get the scripts to work. If I place them in the same scene (on different control nodes), they will both process the input: “A” and “B” will both be printed to the output.
What I wish to do is limit the input processing to one of the two scripts depending on where in the viewport the mouse click occurs.
I have tried, for example, creating two control nodes and set the size to give two rectangles - say each covering half the viewport. However, it doesn’t matter in which control node rectangle the mouse is pressed, both will process the input. I can’t find a way to limit the input processing to a particular script, with the particular script dictated by the location in the viewport in which the event occurs.
There must be someway to limit which script processes the input determined by the location in the viewport in which the event occurs?