As the title suggests, getting a mobile device’s acceleration, rotation and gravity is not possible.
UserInputService’s properties AccelerometerEnabled and GyroscopeEnabled return false. Using GetDeviceAcceleration or the other functions return an InputObject with its Position and Delta as 0, 0, 0.
Confirmed on two different phones:
OnePlus 3 running Resurrection Remix based on Android 7.1.1
Samsung Galaxy Note 4 running Android 6.0.1
Here’s a place for you to test your device’s accelerometer: mobile test - Roblox
edit: Everything seemed to work fine before the servers had issues.
edit2: might be stupid, we’ll see in a few minutes
edit3: Okay, suddenly everything started working again.
edit4: no
edit5: Ehm, okay. The getter functions started to work once I created a separate TextLabel and a LocalScript with this running this:
local UIS = game:GetService("UserInputService")
UIS.DeviceAccelerationChanged:connect(function(Acc)
script.Parent.Text = tostring(Acc.Position)
end)
I can also confirm this on Samsung Galaxy S7, however it works fine on my iPad (forgot its number). It seems to be an Android problem.
I was wondering why the steering in my racing game just didn’t work for my Android, I noticed this about 3 weeks ago? but thought maybe it was something with my code but didn’t really look into it as I had stopped working on the game a long time ago.