diff --git a/Assets/UnitySensors/Runtime/Scripts/Sensors/IMU/IMUSensor.cs b/Assets/UnitySensors/Runtime/Scripts/Sensors/IMU/IMUSensor.cs index 0755710d..313357d8 100644 --- a/Assets/UnitySensors/Runtime/Scripts/Sensors/IMU/IMUSensor.cs +++ b/Assets/UnitySensors/Runtime/Scripts/Sensors/IMU/IMUSensor.cs @@ -52,7 +52,7 @@ protected override void UpdateSensor() _velocity = (_position - _position_last) / _dt; _acceleration = (_velocity - _velocity_last) / _dt; - _acceleration += _transform.InverseTransformVector(_gravity).normalized * _gravityMagnitude; + _acceleration += _transform.InverseTransformDirection(_gravity).normalized * _gravityMagnitude; Quaternion rotation_delta = Quaternion.Inverse(_rotation_last) * _rotation; rotation_delta.ToAngleAxis(out float angle, out Vector3 axis);