For some reason every time I play my scene, the player (camera) rotation is pretty much anything but the angle I want it to be.
Basically it’s facing walls instead of where it should be. Well, sometimes it works, but most of the time does not. I tried w/ and w/o InputTracking.Recenter(), hardcoding correct rotation on Start()…
Yes, you can turn your head, but it’s a seated shooting game. And you use your keyboard (there’s Xbox controller support as well, but I also wanted to keep KB for people w/o Xbox controller) so it’s kinda/very uncomfortable that way.
For me it is using the data from the room callibration I did when I first connected the headset.
Perhaps you can try running the room setup from the Mixed Reality Portal again.
Other than that, you can create a parent node for the “Main Camera” and set that transform to make the camera point in the direction you want.
I did a recenter (orientation only) when “C” is pressed in my app, this is the code that works for me. “CameraTransform” is the parent node of the “Main Camera”:
if (Input.GetKeyDown(KeyCode.C))
{
var camera = GameObject.Find("Main Camera");
var world = GameObject.Find("CameraTransform");
if (camera != null && world != null)
{
world.transform.Rotate(-camera.transform.eulerAngles);
}
}