Android API documentation: https://developer.android.com/guide/topics/sensors/sensors_motion#sensors-motion-rotate
The rotation vector sensor needs to be initialized, then you can read values and once your job done, you can release the sensor.
- InitializeRotationVector: this function will initialize the sensor. If the initialization is successfull, the return value will be true. Otherwise, if the device hasn't this sensor or if the initialization fails, it will return false.
- ReleaseRotationVector: this function must be used in order to release the sensor. Usually, you can call this function at the EndPlay event.
- GetLastRotationVectorMeasure: will gives you the last value of this sensor.
- The A float represents the angle of the rotation vector
- The Estimated heading accuracy float represents the estimated heading accuracy
- The return value Vector3 represents the axis of the rotation
Place this code in your level blueprint : https://blueprintue.com/blueprint/_mtu1135/