Search Issue Tracker

Fixed in 0.3.0-preview

Votes

0

Found in [Package]

0.0.9-preview

Issue ID

1093833

Regression

No

[iOS, Android][Sensors] Cannot set samplingFrequency, trying to set it breaks sensor on iOS

Package: Input System

-

Migrated bug from GitHub: https://github.com/Unity-Technologies/InputSystem/issues/280

Expected result:
InputSystem.EnableDevice(Accelerometer.current);
// Accelerometer.current.acceleration works fine
Accelerometer.current.samplingFrequency = 30.0f;
// Accelerometer.current.samplingFrequency returns 30.0f
// Accelerometer.current.acceleration works fine and samples in frequency that is set

Actual result:

on iOS:
InputSystem.EnableDevice(Accelerometer.current);
// Accelerometer.current.acceleration works fine
Accelerometer.current.samplingFrequency = 30.0f;
// Accelerometer.current.samplingFrequency returns 0
// Accelerometer.current.acceleration stops updating, disabling/enabling doesn't help
The issue here is that samplingFrequency returns 0 instead of actual frequency and that it breaks the sensor

on Android:
InputSystem.EnableDevice(Accelerometer.current);
// Accelerometer.current.acceleration works fine
Accelerometer.current.samplingFrequency = 30.0f;
// Accelerometer.current.samplingFrequency returns 0
// Accelerometer.current.acceleration works fine (can't tell if sampling frequency actually changed though)
The issue here is that samplingFrequency returns 0 instead of actual frequency and possibly doesn't set frequency to the wanted value?

The same happens with all the other sensors

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.