- Home /
Fitness game to detect the user's workout using accelerometer sensor
Hello Guys, I am so lost and hope to seek for help! Basically i want to make a Android game to allow user perform workouts such as squats, sit up and so on. I want to make the game in such a way that when doing squats (or sit-ups, push up), it counts the number of squats by using accelerometer sensor . So is there any idea or guide on how to start off this project?
Answer by Llama_w_2Ls · May 26, 2021 at 02:18 PM
You could start by checking the linear acceleration of the mobile device. To get this, its either Input.userAcceleration
or Input.Accelerometer.userAcceleration
. Im not sure which one, but you can find it on the docs.
Then, if there is a spike in the acceleration, the phone has either dropped/risen etc. You can measure if there is a spike by measuring the change between the last value every update.
Count two spikes per squat/push up. One for pushing down, one for back up. Hope that helps. @wlsiow96
Your answer
Follow this Question
Related Questions
Sensor Fusion of Accelerometer and Gyroscope 0 Answers
Sensor Fusion - Angular Velocity 0 Answers
How do I calibrate my games's pitch (0,0) position on android accelerometer? 0 Answers
Move a Game Object (Camera) forward and sideways with the Mobile Sensor Outputs. How? 0 Answers
Help requested: Google VR / Phone rotation to gameobject. 1 Answer