Inconsistent GuiObject Input (Mouse vs. Touch)

GuiObject interaction behavior is inconsistent between platforms. For example:

A Frame whose Active property is equal to true will sink the input of and prevent it’s parent’s (a GuiButton) Activated event from firing when the input medium is via Touch - whereas the input is not sunk when the input medium is via Mouse.

A repro file and repro steps can be found below:

inconsistent-mouse-touch-user-input-sink-gui-object-behavior.rbxl (64.2 KB)

Steps to reproduce:

  1. Enter Play Mode
  2. Click in both the green and purple area
  3. Note how the TextButton Instance is printed when clicked on in both areas
  4. Enable the Device Emulator and select a mobile device
  5. Click in both the green and purple area
  6. Note how the TextButton Instance is only printed when clicked on in the green area

Optionally, disable the Active property of the Frame that is parented to the TextButton and repeat steps 1 - 6. Note that now, in both cases where input is either Mouse or Touch, the Activated event fires from clicking anywhere in the TextButton. This is the source of the inconsistent input behavior

Expected behavior

As is the behavior for mouse-based input, the Activated event should fire when a GuiButton is clicked on, regardless of the Active property of any descendant GuiObject of that GuiButton

This can be tested by connecting to the InputEnded event to detect when the Frame’s Active property is equal to true, noting that even though it is true, the behavior is not sunk by the GuiButton it is parented to when the input medium is via Mouse

3 Likes

Bump,

I am experiencing something similar in my own game. Mobile players (I believe both Android and iOS) have their touch input sunk on a CanvasGroup that has its Active property set to false.

Inside this CanvasGroup sits a ScrollingFrame (also with the Active property set to false) that holds frames (Active set to true) with buttons (Active also set to true) inside. Said frames have their input sunk as expected, but the CanvasGroup (which takes up a large portion of the right side of the screen) sinks input when it shouldn’t. This results in mobile players not having a comfortable enough room to move their camera in.

1 Like