Bug with iPhoneAccelerationEvent.deltaTime

I have a fixed timestep at 0.003333333, which is very low, and therefore I’ll have more fixedupdate calls than acceleration events.

So, according to the documentation (iPhoneAccelerationEvent.deltaTime: “Amount of time passed since last accelerometer measurement.”), when I call iPhoneInput.GetAccelerationEvent(0).deltaTime at each fixedupdate, the value should increase until a new acceleration event has “fired”. But for me that value stays the same for subsequent fixedupdate() calls as long as no new event have been fired.

P.S: bugs are for the forum, not UnityAnswers, right?

wrong bugs are through the bug reporter only
The board is for chitter chatter :slight_smile:

But your fixed timestep is unrealistic for the iphone. The common setup targets 30 / 60 FPS, thats 0.033 / 0.016, at that point you have some cpu time left to also do a game aside to the physics
Given that you did not intend to cut out anything but 3GS devices right from the start.

It’s true I should consider increasing the timestep and testing on a 3G device. but physics only work correctly (no weird vibrations) if I reduce timesteps down to that level, but that’s another problem.

depending on what you do you can enforce things.

I for example need a ball to remain on a flat surface.
To achieve that, one of the behaviors on the object just 0s the y acceleration and the prob is solved (before that it was really a bouncing ball)

Adjust your “Solver Iteration Count” as well as your fixed time step to remove jitter.

As to your original post, what is the ‘bug’ exactly?

Assuming the event queue is cleared every frame (fps, not fixed update), you are expecting the delta value of acceleration event zero to be large if an event occurs after several frames? But the value is constant? Is that the issue?

Or is the question: Is the accelerometer sampling tied to fps? (which it seems to be)

Edit:
disturbing results after a few tries…

  1. the event queue size is always 1
  2. the delta time values range from 0.02 to 0.08

This is a bit weird assuming Update is called 1x per frame (as often as the queue is updated). This would only make sense if you could increase the sample frequency to higher than than the frame rate. Maybe there is a setting for this?

Edit2:

At least in answer to the update frequency, Brian Kehrer dug this up… (I completely forgot about AppController.mm)

“To specify desired processing frequency for the accelerometer you will have to open the Unity generated XCode project, select AppController.mm file and change #define kAccelerometerFrequency 60 to a different value, for example: define kAccelerometerFrequency 10”