So as I’m in the progress of goofing around with VR stuff I had tried to get my players left arm to follow the left controller.
Good news, it moves.
Bad news, its offseted from the right place by a lot.
How can I make it so the left arm is in the right place?
-- services
local VRservice = game:GetService('VRService')
local players = game:GetService('Players')
local runService = game:GetService('RunService')
local UserInputService = game:GetService('UserInputService')
local Rstorage = game:GetService('ReplicatedStorage')
-- player
local player = players.LocalPlayer
if VRservice.VREnabled then
warn('Using vr!')
VRservice.FadeOutViewOnCollision = false
else
--player:Kick('this game only supports VR! sorry :D')
end
local char = player.Character
-- get joints and arms of the player
local LHand = char:FindFirstChild('Left Arm')
local RHand = char:FindFirstChild('Right Arm')
local leftShoulder:Motor6D = char:FindFirstChild('Torso'):FindFirstChild('Left Shoulder')
local rightShoulder:Motor6D = char:FindFirstChild('Torso'):FindFirstChild('Right Shoulder')
local cam = workspace.CurrentCamera
repeat task.wait(3) until LHand and RHand and rightShoulder and leftShoulder
-- make parts not transparent in first-person
for _, part in pairs(char:GetChildren()) do
if part:IsA('BasePart') then
part.LocalTransparencyModifier = part.Transparency
end
end
UserInputService.UserCFrameChanged:Connect(function(hand,move) -- make left arm follow
if hand == Enum.UserCFrame.LeftHand then
leftShoulder.C1 = cam.CFrame * move
--LHand.CFrame = cam.CFrame * move
end
end)
UserInputService.UserCFrameChanged:Connect(function(hand,move)
if hand == Enum.UserCFrame.RightHand then
--RHand.CFrame = cam.CFrame * move
end
end)