I want to achieve a just dance like controller, for example you can use your mobile device as a controller to detect if you are mirroring the target character. For that I need to get the position of the mobile device accordingly relative to the ingame positions so I could easily check if the users is replicating the tagret.
I know there is :GetDeviceRotation() etc. But that only gives Vector3 of the orentation but I need the position.
Where would I start to script something like a just dancec mobile controller?
local UserInputService = game:GetService("UserInputService")
local gyroEnabled = UserInputService:GyroscopeEnabled()
if gyroEnabled then
local inputObj, cframe = UserInputService:GetDeviceRotation()
print("CFrame: {",cframe,"}") -- a cframe! use .Position to get the position ig. I dont know much about it.
else
print("Cannot get device rotation because device does not have an enabled gyroscope!")
end
I personally think that you cant. You can only ig get it in VR.
i think if you would use the acceleration you could get a position (im taking a wild guess) but I dont exactly know how I would do that. Because I would need to somehow calibrate it and then from that point see how it moves with the acceleration.
It seems to complicated for, is there maybe a premade module for that or something?