Hi! I want to create a VR project in which you can see the whole avatar and control it from behind (as in third person). I took my VR camera and parented it to the player armature (avatar taken from third person unity assets). The camera follows my avatar, but anytime I turn (I’m using WASD), the camera turns as well. It’s as if the camera rotates around the player whenever it turns and is disorienting.
How can I make the camera more stable? In short, I want the player movement not to affect the camera, besides that it moves forward when the player does (so that it’s not left behind).
Interesting approach. I’m curious what this would feel like in VR!
I think to get it working you need to:
NOT parent the VR camera to the player, but instead leave it as is
after moving the player, copy the position you want over to the VR camera without changing its rotation
The position you want I suppose would be above, behind, perhaps slightly to one side of the player, so something like…
// code to make VR transform follow the player from behind without rotating
Transform pt = ... however you get the actual moving player transform...
Vector3 position = pt.position + pt.up * 1.0f + pt.right * 1.0f + pt.forward * -5.0f;
// now assign position to the VR camera transform, however you wanna reference it
My intuition is that this might be vomitous if you turn the player, because however far behind the player you are, you will get whipped sideways positionally simply by the turning.
Another way might be to just move it towards the player whenever it is beyond the distance you want it to be…