Hi, a few days ago I was finally setting up all save actions/custom remember scripts/etc to save in a VR project I'm working on, but we found a VR bug. Whenever we loaded a saved game the rig's camera would get messed up completely. After lots of investigating I finally found the issue: The MainCamera script is resetting the camera's position, rotation and FOV during load. So, commenting out the following code in LoadData() removed the bug:
/*
transform.position = new Vector3 (playerData.mainCameraLocX, playerData.mainCameraLocY, playerData.mainCameraLocZ);
transform.eulerAngles = new Vector3 (playerData.mainCameraRotX, playerData.mainCameraRotY, playerData.mainCameraRotZ);
ResetProjection ();*/
Would it be possible to have a toggle to enable/disable this code (if Virtual reality is on)? I'm not sure if it'll happen in all cases, since I'm also using VRTK, which needs to keep track of the camera to setup player presence,etc. So the camera changes may be breaking its functionality. So, I'm a bit unsure this may happen to people who aren't using VRTK. Though, I'm pretty sure we saw this issue from the beginning of development (we just kinda left saving as one of the last stuff to setup...).
Anyone else using VR with AC has seen this issue before? (For Vive/Occulus platforms).
Comments
How is your MainCamera set up, exactly? The provided MainCameraVR prefab is arranged so that the MainCamera's actual Camera can be rotated independently of the transforms made by the MainCamera. Is the VR camera part of your MainCamera, or treated like a regular GameCamera?
It would be trivial enough to add a check for VRSettings.enabled in there, but - in your experience - do you think there would be a scenario where that would be True yet you'd want that code to run?