Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Losing Accelerometer in Android

Discussion in 'Android' started by MatthewHarmon, Nov 2, 2017.

  1. MatthewHarmon


    Mar 5, 2015
    Hey All:

    Anybody experience this: Occasionally we will lose accelerometer input (in Android builds at least.) We display the raw data from Input.acceleration and upon failure it returns a (0,0,0). The accelerometer comes back to life if we task switch away from the app and back to it - or by exiting the app and rebooting.

    It seems to happen more on some devices than on others.

    Any thoughts about this loss of data, or what might be called during an app restore (OnApplicationFocus) that might be waking the accelerometer input system back up?
  2. JuliusM


    Unity Technologies

    Apr 17, 2013
    Hi, please submit a bug report and paste the case number here. Specify which Unity version you use, list devices, Android OS version and how easily the issue is reproducible on them. Also provide any additional information that would help us to reproduce this issue. Do you just let your project run while the device is laying on the table or do you move device in specific ways (horizontally / vertically, tilting, rotating)? How long do you have to wait for the issue to happen?