- Home /
Detect shake motion on the mobile
I want to simulate the pour operation(like push forward the bottle of salt and the salt will come out) on the android.The main idea is to use the acceleration.
but when I use the Input.acceleration in the unity3d, I find that firstly if it give you a positive acceleration and then it will give a negative number, so I can't judge the direction of my shake by the acceleration.
Does anyone have ideas?
I haven't used the acceleration Input myself and I don't work on mobile devices however it would be expected that the last reading of the accelaration would be negative as you first accelerate the device and then decelarate it back to rest I would assume. you could try printing the accelaration for anything >1 to see if it is simply recognising you slowing the device back to 0 speed?