I’ve been working on a vr game for a while now but there’s one really annoying problem that I don’t know how to fix
when testing I noticed there is extreme delay when moving my controllers
here’s an example:
Vr Controller - Roblox Studio (gyazo.com)
and this is the code I’m using (client side)
local player = game:GetService("Players").LocalPlayer
local character = player.Character
local Head = character:WaitForChild("Head")
local Camera = game.Workspace.CurrentCamera
local starterGui = game:GetService("StarterGui")
local UserInputService = game:GetService("UserInputService")
local VRService = game:GetService("VRService")
HeadScale = 1
Camera.HeadScale = HeadScale
starterGui:SetCore("VRLaserPointerMode", 1)
--starterGui:SetCore("VREnableControllerModels", false)
local LeftHand = character:WaitForChild("LeftHand")
local RightHand = character:WaitForChild("RightHand")
game:GetService("RunService").RenderStepped:Connect(function()
local cfRH = VRService:GetUserCFrame(Enum.UserCFrame.LeftHand)
script.RemoteEvent:FireServer("Align",LeftHand,(Camera.CFrame*CFrame.new(cfRH.p*HeadScale))*CFrame.fromEulerAnglesXYZ(cfRH:ToEulerAnglesXYZ()))
local cfRH = VRService:GetUserCFrame(Enum.UserCFrame.RightHand)
script.RemoteEvent:FireServer("Align",RightHand,(Camera.CFrame*CFrame.new(cfRH.p*HeadScale))*CFrame.fromEulerAnglesXYZ(cfRH:ToEulerAnglesXYZ()))
end)
The server side is just setting the CFrame of the hand to the one provided in the event
I’m aware that there’s a client server delay but if I have the hands on the client there wouldn’t be a way to detect and hold objects.