Using phone compass as a sensor in the game

In a desktop (Windows) VR application, I would like to use my phone as a sensor which uses its compass to change view, for example when the player rotates his/her phone, avatar in the game also rotates. I want to connect my phone via bluetooth to the computer. Is this possible in Unity?

Doesn’t look like impossible.

There already exists a similar application called Unity Remote which is developed by Unity itself to allow developers to use their phones/tablets as input devices. You want to do something similar using bluetooth.

You will need to develop plugins for Unity in order to do this as there is no readymade solution (as long as I know) which will do this for you.