VR Arms get offset the further away you are from the center of your playspace

As the title may suggest, my vr arms are getting offset for some reason

(close to the center of my playspace)

(far from the center of my playspace)

I’m unsure what is causing this. I feel like it may be a headscale issue however.

(client code)

local RunS = game:GetService("RunService")
local VRS = game:GetService("VRService")
local RS = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local Camera = workspace.CurrentCamera
local Player = Players.LocalPlayer
local PositionEvent = RS.Events.Positions

local LArm = nil
local LABall = nil
local RArm = nil
local RABall = nil

function PositionArms()
	local lcframe = Camera.CFrame * VRS:GetUserCFrame(Enum.UserCFrame.LeftHand):ToWorldSpace(CFrame.new(0,0,0)) * CFrame.Angles(math.rad(90),0,0)
	local rcframe = Camera.CFrame * VRS:GetUserCFrame(Enum.UserCFrame.RightHand):ToWorldSpace(CFrame.new(0,0,0)) * CFrame.Angles(math.rad(90),0,0)
	
	if LABall and RABall then
		PositionEvent:FireServer(LABall,lcframe,RABall,rcframe)
	end
end

Player.CharacterAdded:Connect(function(Character)
	LArm = Character:WaitForChild("Left Arm")
	LABall = LArm:WaitForChild("Ball")
	RArm = Character:WaitForChild("Right Arm")
	RABall = RArm:WaitForChild("Ball")
	
	LArm.Transparency = 0.5
	RArm.Transparency = 0.5
	
	local HL1 = Instance.new("Highlight",LABall)
	HL1.OutlineTransparency = 1
	HL1.FillColor = Color3.fromRGB(0,70,255)
	local HL2 = Instance.new("Highlight",RABall)
	HL2.OutlineTransparency = 1
	HL2.FillColor = Color3.fromRGB(0,70,255)
	
	Camera.CameraType = Enum.CameraType.Scriptable
end)

RunS.Heartbeat:Connect(PositionArms)

(server code)

local RS = game:GetService("ReplicatedStorage")
local Events = RS.Events
local PositionEvent = Events.Positions

PositionEvent.OnServerEvent:Connect(function(player,lball,lcframe,rball,rcframe)
	lball.CFrame = lcframe
	rball.CFrame = rcframe
end)

Is there any possible way to fix this?

3 Likes

The proper way to position the VR Hands is this way:

local LeftHandCFrame = game:GetService("VRService"):GetUserCFrame(Enum.UserCFrame.LeftHand)
LeftHand.CFrame = Camera.CFrame * (LeftHandCFrame.Rotation + LeftHandCFrame.Position * Camera.HeadScale)

Your script missed Camera.HeadScale, which is probably what is causing the issue.

3 Likes

Wasn’t HeadScale in my case, seperating the CFrame Position and Rotation fixed it (Honestly it shouldn’t of done anything? I don’t know though.) Thanks though!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.