Get Device Movement

Hi guys,

I want to know if my android device moves along one of the three axes. I do not want to know the rotation of the device which I get from the

Input.acceleration

I would like to build a litte VR game with 2 Android Devices. One Device is in the VR-Glass. And the other one is in my hand. Now I would like to move an Object in the VR-glass / on the first device depending on the movement of the second device. So when i move the second device upwards the object should also move upwards.

The connection will be realized via Networking. Thats no problem. But how do I get the Movement of the second device and not only the rotation?

Thank you

Does anyone have an idea?

You won’t be able to fight drift very long, but if it’s short movements you should be fine. Velocity is the integral of acceleration. Position is the integral of velocity.

Basically, the double integral of the acceleration Vector3 will give you posiiton.

Gyros and accelerometers by themselves aren’t a robust solution to fight drift. There is a reason Valve (lighthouse) and Oculus (IR-LED camera) use supplementary systems to achieve room scale tracking.