Accelerometer stuck :(

Last few days I found that, after giving the build in my iPhone, accelerometer stuck and I can’t control my controlling object. Let me explain more.

I’m accessing the accelerometer in LateUpdate () function and a rigid body rotation is calculating based on accelerometer value. This problem doesn’t maintain any sequence. When it’s happen, the RB rotation stuck as no reading from accelerometer. Then I exit from the game restart the game again then it’s work. Mind it, I’m unable to generate the problem as there is no sequence that I can follow for it.

Can anyone help me for this? any body faced that problem before?

I think that the first step is to decouple the issues:

  • Is the accelerometer actually “stuck”?

or…

  • Is your code wonky such that it’s making the accelerometer appear “stuck”?

In short, put a simple GUI element on screen that shows the accelerometer’s x, y and z values to see whether it’s actually stuck or if there’s something wonky in your code. With that work done we can then dig deeper… :slight_smile:

That’s a good point. I’m trying to re-do the stuck again but as I mentioned there is no sequence for it. I will update in GUI way. There may be few factors:

  • My Code [which is working in LateUpdate() ]
  • Accelerometer
  • mono script call

I will update whenever I get the result.