I have a game where the character finds an object. After finding an object, the screen goes black for a few seconds and the player starts in a new location facing a new direction. My script works fine in non-VR mode.
However, when the VR is on, the head rotation for oculus takes over and I can’t restart my character facing a new direction. Rotating the character or mouse look with the following scripts does not work during VR:
void OnTriggerEnter (Collider other) { if (other.gameObject.tag == "coin") { FPC.mouseLook.m_CameraTargetRot = Quaternion.Euler(0f, 180f, 0f); } }
or
void OnTriggerEnter (Collider other) {
if (other.gameObject.tag == "coin") {
transform.rotation = Quaternion.Euler(0f, 180f, 0f);
}
}
I should emphasize that the screen will be black during the forced rotation. So a person playing the game won’t notice the rotation until the black screen disappears. So the forced rotation will not cause nausea or motion sickness.
The only way I can get this to work is to turn off the VR during the black screen, rotate the character, and then turn the VR back on. However, there’s a little noticeable lag during the black screen. And turning the VR on and off throughout the game seems to slow things down.