New Input system breaks gyro support :(

Hi all,

I just realised the new Input system breaks the gyro support on iOS.
SystemInfo.supportsGyroscope always returns false.
(This is in Unity 2019.4 LTS with Input system 1.0.0)

Does anyone know a way to hack this into working?
I’m too far in with the new system to revert back to the old input system.

Thanks,
Pete

Ah, my guess is the “Active Input Handling” player setting is disabling the path that initializes that property. Likely needs to get looked at. Would you mind filing a ticket with the Unity bug reporter? (“Help >> Report a Bug…” in the editor’s main menu)

For a workaround, my guess is that setting “Active Input Handling” in the player settings to “Both” should probably get the property initialized properly again.

Okay, I put a bug report in. (Case 1285994). I’ll check out those settings first thing tomorrow and see how it goes. :slight_smile:
Thanks,
P.

Thank you :slight_smile:

Cool, setting to both worked. Thanks for that :slight_smile:

Confirming that setting “Active Input Handling” to “Both” in Player Settings does work on iOS in 2020.2.0b10.

(Initially, this post was me reporting that it didn’t work, but there was a bug in my code that was actually the culprit.)

1 Like

Hey @ExNinja the problem is we aren’t using the new implementation of the gyro sensor.
https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.Sensor.html

It’s all a bit vague though…

Thanks, @petey . My problem was actually another bug that I’ve fixed now. I’ve updated my post. Thank you again for the feedback. :slight_smile:

1 Like

In 2021 this is still a problem. I use 2020.3.12 (LTS for reason)

I created a simple scene where the smartphone controls the camera rotation. I wanted to use the new InputSystem. The result:

  • on android it works at first start, but if you pause the app and then resume, the gyro won’t work again
  • on ios the gyro does not work

I switched back and used the old input system and everything works.

So I’d like to ask the unity team, to create a simple gyro app for an iPhone and during this journey please fix the bugs.
One one the first anoying thing is

‘Gyroscope’ is an ambiguous reference between ‘UnityEngine.InputSystem.Gyroscope’ and ‘UnityEngine.Gyroscope’

But this is just the beginning and at the end it does not work reliable.

1 Like

Would you mind filing a ticket with the Unity bug reporter? (“Help >> Report a Bug…” in the editor’s main menu)

Which version of the input system package? I believe gyro support for iOS landed in one of the 1.1 preview versions.

I used the verified 1.0.2 version. Good to know, that it is worked on. In the docs I read that gyro sensor in iOS with new input system is supported already.

I’ll clean the code to easily switch the input systems, update unity version and write a bug report, hopefully this week…

Hmm, digging through the changelog pretty sure I was wrong about gyro support and 1.1 previews. The stuff happening in the previews was about other sensors in iOS. Must be something else then. Might be worth firing a ticket off about this one, too. To my knowledge, this should be working just fine.

I filled a but report: (Case 1362730) Gyroscope / Attitude Sensor Problem on Android after pausing app

I filled another bugreport about IOS with an updated project.
(Case 1362779) Gyroscope / Attitude sensor problem on IOS using the new Input System

Hey I just noticed the weird order on the Input system packages so I updated to 1.1.0-pre.6 from 1.1.0-preview.3 and that broke gyro support for me.

Now when I try to start the gyro

gyroScope = UnityEngine.InputSystem.Gyroscope.current;

I get - Gyro not available

It was working in 1.1.0-preview.3 on my iPad and iPhone (haven’t tested on Android yet sorry).
I rolled back to 1.1.0-preview.3 so I have something to test with for the time being but I was wondering, is that likely to come back?

1 Like

UnityEngine.InputSystem.Gyroscope.current does not send me the correct value at each frame. It gives me (0,0,0) for at least 10sec on my phone then gives me some value, then freeze randomly

@Fangh any update on this? i am facing same issue.