Problem moving player with IMU
I have made 2D game and I want to control my player with an IMU (BNO055 sensor connected to an Arduino with a BT module). I connect to my Android Unity app through Bluetooth and receive the data from the IMU just fine. I would like my accelerometer data x and y move (not rotate but move) my player smoothly on the X and Y axis. My problem is that my IMU accelerometer x value goes from 0 to 360, and my Unity scene is only 12 units scale (and I need to keep it that way) and I don't want the Player to be able to go off screen. If I use the raw data, it's really hard because the scene scale is very small compared with the x range. How can I scale/convert the data in order to get a simple and smooth movement in my scene ? I've tried eveything I could think of so far (using raw data, adding x value to transform.position.x, using filters), but I can't figure out a good way to do that. I can provide the code or any more details if necessary. Thank you very much.
Your answer
Follow this Question
Related Questions
Getting linear acceleration not using gyroscope on Android 2 Answers
Move sprite in Y based on phone tilt 0 Answers
Using mobile device (sensors) as remote to control PC simulation 0 Answers
Unity3D accelerometer camera rotation realistic controls 0 Answers
Motion based Gesture recognition using accelerometer or gyroscope 1 Answer