When Unity runs with a VR headset (and the “Virtual Reality Supported” switch is turned on), the active camera follows the HMD’s movements.
But my scene has two cameras. One for the player, one for a mirror (the mirror is important, so I don’t want a pixelated/blurry render texture and use the Mirror Effect asset)
The camera used to render the mirror also follows the HMD’s movements. How do I stop it from doing that?
In Disabling Head Tracking@Ed_unity says that unsetting “Target Eye” will stop head tracking (and HMD rendering altogether), but I assume that’s not current anymore as there is no such option in Unity’s native camera.
In Completely Disable Position Tracking@NickAtUnity posted a script that negates head movements by giving the camera a parent game object that moves counter to the head tracking, returning the camera to its original position.
Update: Tested with Unity 5.6, @NickAtUnity 's method causes little hickups and skips on the camera. Are the head tracking coordinates polled upon query instead of being saved until Update()+LateUpdate() have finished?
Up until here it looks like I cannot complete my project with Unity (or either VR or the mirror have to go :()
I have exactly the same problem. I’m trying to implement a different tracking that calculates position and rotation on another machine and sends the correct values to unity via OSC.
And i have the same problem of @Cygon4 . At the moment i’m using the @NickAtUnity 's method, but as noted already causes hickups to me as well, no matter if I use Update(),LateUpdate(),FixedUpdate().
I’ve also noticed that making the camera the parent of all the world apparently result in a “Stable” still world.
Apparently this is something that Unity achieved quite recently, and before also parenting objects to the camera was causing “desync” between the rotation from the headset and the position/rotation of the child object. https://forum.unity3d.com/threads/jitter-when-objects-are-moving-rapidly-or-attached-to-the-camera.435048/
So, hoping for a easy solution in the future (like a switch to activate/deactivate hmd tracking), i’ll try the reverse solution (parenting all to the camera, and then rotate and move the world in an inverse way), but i’m not really sure to know how to do it
i’ll send any progress
ps. sorry fo rmy english
@FenyceAssets That’s a pretty extreme measure - it would require everything in the world to be dynamic.
I’ve tried modifying the stencil camera script to update the camera position in OnPreRender() but even then it still renders the mirror camera with the orientation and position of the HMD.
The “Target Eye” property is there in VR mode (I didn’t see it because I was testing mouse controls), but when I switch it off, the camera will no longer render on the HMD, producing the old “hall of mirrors” effect instead of the desired reflection.