When using VR the camera maintains a stationary position and your view is offset from the camera object so when I try to run the code below it acts as if it were being moved reletive to the world and not the way you are facing. I need help,
So, I’ve done some VR stuff in the past. I had this issue. The best solution I could find is setting the camera’s CFrame or position(I forgot which it was sorry) To the Position of the VR headset.
here is a script i made that requires head, right hand and left hand parts to be in the workspace
local VRService = game:GetService("VRService")
if VRService.VREnabled == true then
workspace.hand1.Transparency = 1
workspace.hand2.Transparency = 1
workspace.chand1.Transparency = 0.65
workspace.chand2.Transparency = 0.65
workspace.CurrentCamera.CameraType = "Scriptable"
wait()
workspace.CurrentCamera.CFrame = CFrame.new()
local InputService = game:GetService("UserInputService")
VRService.UserCFrameChanged:Connect(function()
local LeftHand = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
local RightHand = VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
local Head = VRService:GetUserCFrame(Enum.UserCFrame.Head)
workspace.chand1.CFrame = (LeftHand)
workspace.chand2.CFrame = (RightHand)
workspace.vr.stuff:FireServer(RightHand,LeftHand,Head)
end)
end
This Is local
function who(player, RightHand, LeftHand, Head)
workspace.hand2.CFrame = (RightHand)
workspace.hand1.CFrame = (LeftHand)
workspace.head.CFrame = (Head)
end
script.stuff.OnServerEvent:Connect(who)
Dude, this post was over a year old when you replied. They probably won’t see it, or, if they do, it’s buried deep in their code/is already improved.
Please don’t necropost. If a post’s last reply is over a month or so, it’s wise to not reply ESPECIALLY if you’re just going to be telling someone off for bad scripting.