I’m trying to make my first VR game, and to get used to the services I wrote up this simple script to just put my head in the roblox world:
game:GetService("VRService").UserCFrameChanged:Connect(function(ucf, cf)
if ucf == Enum.UserCFrame.Head then
workspace.CurrentCamera.CFrame = cf
end
end)
Studio (and play online) get my headset input, however it seems to not translate 1:1 to real movement so I get dizzy after playing the game for just a few seconds. Specifically it looks like I can move my head 180° in real life, but my camera makes a full 360° turn in game. Is my script wrong, or do I need to do something else to achieve this effect?
It’s hard to capture the situation in a clip, because it fails to show the issue entirely unless I also record my physical body movement.
In this example, I’m turning my (physical, real) head 180° to the right, then back facing forward. Realistically, my camera should first face the character, then face away from the character, then back to the character, but instead it makes a full 360° turn.
Looking at the footage, the Roblox UI seems to correctly follow my head, as it turns less than the in-game camera. Perhaps there’s some existing camera logic I have to disable first?
I also don’t see how Heartbeat/which type of event I use would influence the issue at all. In fact, trying it now, it produces exactly the same result.
Changing the Camera.FieldOfView doesn’t do anything, I presume because field of view is controlled entirely by which headset you’re using and cannot be influenced by any means.