I’m trying to make the hand models go a little bit infront of the Camera (Block)
What I have:
What I want:
I tried doing a bunch of stuff and it all didn’t work, and I haven’t checked the dev-fourm
I’m making a VR Script
local vrapi = game:GetService("VRService")
local Cam = workspace.CurrentCamera
local rh = workspace.rhand
local lh = workspace.lhand
local hh = workspace.head
local distcamera = 5
local hs = Cam.HeadScale
local function ta(tablea, number)
local tableb = {}
for i,v in pairs(tablea) do
if tonumber(v) then
v = v - number
table.insert(tableb, tonumber(v))
end
end
return tableb
end
game:GetService("RunService").RenderStepped:Connect(function()
local cfRH = vrapi:GetUserCFrame(Enum.UserCFrame.RightHand)
local rhrot = cfRH - cfRH.p
local camrot = Cam.CFrame - Cam.CFrame.p
rh:SetPrimaryPartCFrame(camrot * rhrot + Cam.CFrame * (cfRH.p*hs))
local cfLH = vrapi:GetUserCFrame(Enum.UserCFrame.LeftHand)
local Lhrot = cfLH - cfLH.p
lh:SetPrimaryPartCFrame(camrot * Lhrot + Cam.CFrame *(cfLH.p*hs))
local cfHH = vrapi:GetUserCFrame(Enum.UserCFrame.Head)
local Hhrot = cfHH - cfHH.p
hh.CFrame = camrot * Hhrot + Cam.CFrame*(cfHH.p* hs)
end)