Hi everyone. I am building a game and I need to know how fast a user is shaking his or her phone. The faster they shake the more points they will collect. Is there any special piece of code that would tell me this in Unity?
Thanking you in advance.
Hi everyone. I am building a game and I need to know how fast a user is shaking his or her phone. The faster they shake the more points they will collect. Is there any special piece of code that would tell me this in Unity?
Thanking you in advance.
Check the acceleration of the device, check how long before the polarity changes and that tells you how hard the guy is shaking.
Actually, step 8 may be discarded, considering that if the shaking becomes too low during the process then you put shakingValue down to 0. It would be a design decision.