Is there any way I can code my game so mobile players can use the gyroscope in their phone to control stuff like maybe a ball rolling or the camera?
It would be even cooler if they could do that with a controller like a vr controller, joy-con, wiimote, psmove, etc. but even though that would be better it’s probably harder and less possible.
Im not too sure about controllers allowing this based on my research but I know gyroscope and Accelerometer sensors on mobile/tablet devices but this is not yet supported by Roblox.
A few weeks ago, I actually thought about doing something like this. I wanted to make some game where the player would have to get a ball through a maze by tilting the phone.
I kind of got bored and stopped after like 10 minutes lol.
local uis = game:GetService("UserInputService")
while true do
if uis.GyroscopeEnabled then
local _, gyroCf = uis:GetDeviceRotation()
workspace.testPart.CFrame = gyroCf
else
warn("No gyroscope was found.")
return
end
wait()
end