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
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
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Character animation freezes when toggling animator on/off in a coroutine
- Certain textures are incorrectly marked in the render pass list when observed through Render Graph Viewer
- "Assertion failed on expression" error occurs when multiple Animation Components are instantiated after changing the Culling Type
- MacOS persistentDataPath uses old path when built compared to Editor Play mode
- Crash on RaiseException when entering Play Mode in a specific project
Add comment