UserInputService.TouchEnabled still doesn't detect my phone as a mobile device

I’m using a Huawei P20 Pro. I’m not sure if this is related to the recent US vs Huawei issue, but the script is totally functional and works with other types of brands.

The script absolutely has no problems detecting other types of devices and I don’t mind if it makes the UI on tablets small cause it’s not meant for a game, but it keeps detecting my phone in a wrong way.

A line which detects whether an user is using a touch-based device

if UIS.TouchEnabled and not UIS.KeyboardEnabled and not UIS.MouseEnabled and not UIS.GamepadEnabled and not GuiService:IsTenFootInterface() then
	print(Player.Name.." is using a touch device")

Are other Huawei users experiencing this? Is there a more efficient way of detecting a device? I’m not looking to reduce GUI size or anything, it’s mostly about GUI scripts which are only functional for touch screens.

Help is appreciated. :upside_down_face:

2 Likes

I have a Huawei P30 Pro, this works fine on my device. What EMUI + Android version are you running?

1 Like

Your script has absolutely no problem. I’ve checked Huawei’s official website and confirmed that Huawei P20 Pro is not a 10 foot interface. Maybe it’s because of your device’s softwares.

Using any of these features to detect device is bad. Detecting device at all for anything other than analytics is bad (possibly unpopular opinion). That being said, you may want to look into GetLastInputType as well as some sort of buffer to get this event to fire. It can help you determine what kind of input was passed when the player interacts with something.