cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting Controller Shake

Glightgames
Protege
Hi all,

Does anyone know how I can go about detecting the player shaking one of the Touch controllers in Unity 5?
2 REPLIES 2

SiggiG
Protege
Keep a history of X frames of position data and put in a threshold when they move more than X units Y amount of times within say a second?
CCP Games, EVE: Valkyrie developer | @SiggiGG

galopin
Heroic Explorer
Not that simple, it could also be a rotational shake, twisting the wrist. I think a way to detect is to monitor the sign of the sensor acceleration values ( positional and rotational ),

keep a history over the duration you want to monitor, count for each component the number of time they change sign, and trigger a shake event if the count is above a threshold.

The biggest issue is how to detect the shake quickly enough, without false positive and not too slow to not create latency in applying the shake to whatever it has to impact in the VR world.