- Home /
Get Iphone gforce values.
I am trying to make a ball move using the -x motion of the accelerometer. I looked in the documentation and was able to achieve making the ball move in in the right direction using just that axis, but how can I measure the gforce of that axis of the accelerometer to make the balls speed of movement based on the amount of gforce (caused by the speed of the device movement) that the accelerometer is registering?
The example is the documentation has a constant speed set by a variable, I dont want the speed to be constant like that. If the phone moves faster, I want the object to move faster.
Answer by Eric5h5 · Nov 20, 2010 at 10:27 PM
The accelerometer only tells you what direction "down" is according to gravity, not g-force or anything else.
If you're moving the phone, the accelerometer tells you in what direction the phone is accelerating. That includes the acceleration due to gravity, and the acceleration due to the force you're exerting on the phone.
Answer by almo · May 04, 2011 at 07:26 PM
The acceleration values are reported as floats. You could alter the speed by scaling it by the size of those floats. I'd need to see your code.
Speed *= iPhoneInput.acceleration.x;
Your answer
Follow this Question
Related Questions
Incremental acceleration with Imput 1 Answer
Unity Remote - Alternatives 0 Answers
Accelerometer calibration works on Unity Remote, but not on device after build.. 1 Answer
How do you bring up the mobile keyboard without this area? 1 Answer
how to create buttons using iphone look and feel?? 2 Answers