Mobile Gyroscope not detected

When I try to detect the gyroscope sensor in a phone using the UserInputService, it just doesn’t detect it or return false in UserInputService.GyroscopeEnabled

What I expect: UserInputService.GyroscopeEnabled should return true in devices with gyroscope

Frecuency: Always happening

Reproduction steps:

  1. Create a LocalScript that prints UserInputService.GyroscopeEnabled
  2. In certain models it prints false, even if the device has a gyroscope

Phone Model: moto g20
Android version: Android 11
Roblox Version: 2.607.548

Code:

local UIS = game:GetService("UserInputService")
UIS.DeviceRotationChanged:Connect(function(a,b)
print(b)
end)
while 1 do
wait(1)
print(UIS.GyroscopeEnabled) --false
end

The gyroscope is detected in other apps

1 Like

Hey, so sorry for the late response. Found someone to look at this. We’ll get back to you when we have an update.

Hi! I looked into this and couldn’t reproduce the issue with my test devices. E.g. the following code worked to read the gyro orientation from a local script:

while 1 do
wait(1)
if UIS.GyroscopeEnabled then
local _inputObj, cframe = UIS:GetDeviceRotation()
script.Parent.Text = "Gyro Orientation : " … cframe.lookVector.y
end
end

Are you still encountering the issue and does my test place work for you? : Gyro Test place - Roblox

1 Like