- Home /
VR Camera using Input.acceleration
Hi guys,
basically I'm trying to create a 3D mobile game where the user controls the vision of the character by pointing the phone where they want to look as if looking through a window into another world. I know it would probably be better to use input.gyro.attitude? from what I can tell but It doesn't work on my android device because it doesn't have a gyroscope (i think... it's not actually my device I just get to test on it occasionally). is there a way for me to convert input.acceleration to do this since that definitely does work on that device (I don't know what type of values it returns though, I think it's 0 parallel to the ground to 1 and -1? but obviously I have no idea)
Many thanks, Alec.
Answer by TheFloatingSheep · May 10, 2015 at 08:39 PM
I had the exactly same problem yesterday. I searched everywhere, and nope... It's not possible to use the Accelerometer instead of Gyro... :/ :( If you try the CardBoard Asset you'll see that it uses the Accelerometer a little bit, but it doesn't work the same, it only detects tilt and shaking.
That's really lame, but surely since the accelerometer returns a value between 0 and 1 I could do something like multiply it by 360 and make the transform rotation equal to those values, something like that would work? I just don't know because I have nothing to test it on and I'm not sure about the values it returns
Answer by Martians135 · Nov 11, 2017 at 03:16 PM
yes! Now it's possible! Thanks to this asset: https://www.assetstore.unity3d.com/en/#!/content/87609