Problem with VR Controllers position and rotation

Hello!
I got a problem when i try to use VR Script
Here’s video:

And script with that i have problem:

vrs.UserCFrameChanged:Connect(function(thing, cframe)
		local RightHandCFrame = vrs:GetUserCFrame(Enum.UserCFrame.RightHand)
		local LeftHandCFrame = vrs:GetUserCFrame(Enum.UserCFrame.LeftHand)
		local HeadCFrame = vrs:GetUserCFrame(Enum.UserCFrame.Head)
		
		local RightHandMathified = CFrame.new(Cam.CFrame.Position) * CFrame.new((RightHandCFrame.p-HeadCFrame.Position)*HeadScale) * CFrame.fromEulerAnglesXYZ(RightHandCFrame:ToEulerAnglesXYZ())
		local LeftHandMathified = CFrame.new(Cam.CFrame.Position) * CFrame.new((LeftHandCFrame.p-HeadCFrame.Position)*HeadScale) * CFrame.fromEulerAnglesXYZ(LeftHandCFrame:ToEulerAnglesXYZ())
		local HeadMathifed = Cam.CFrame
		
		RightHand.CFrame = RightHandMathified
		LeftHand.CFrame = LeftHandMathified
		Head.CFrame = HeadMathifed
	end)

Any ideas how to fix it?

1 Like

Fixed it by CFrame.new and CFrame.Angles
If you have problem like me here’s script:

vrs.UserCFrameChanged:Connect(function(thing, cframe)
		local RightHandCFrame = vrs:GetUserCFrame(Enum.UserCFrame.RightHand)
		local LeftHandCFrame = vrs:GetUserCFrame(Enum.UserCFrame.LeftHand)
		local HeadCFrame = vrs:GetUserCFrame(Enum.UserCFrame.Head)
		
		local RightHandMathified = CFrame.new(Cam.CFrame.Position) * CFrame.new((RightHandCFrame.p-HeadCFrame.Position)*HeadScale) * CFrame.fromEulerAnglesXYZ(RightHandCFrame:ToEulerAnglesXYZ()) * CFrame.Angles(1, 0, 0) * CFrame.new(0, 1, 0)
		local LeftHandMathified = CFrame.new(Cam.CFrame.Position) * CFrame.new((LeftHandCFrame.p-HeadCFrame.Position)*HeadScale) * CFrame.fromEulerAnglesXYZ(LeftHandCFrame:ToEulerAnglesXYZ()) * CFrame.Angles(1, 0, 0) * CFrame.new(-0, 1, 0)
		local HeadMathifed = Cam.CFrame
		
		RightHand.CFrame = RightHandMathified
		LeftHand.CFrame = LeftHandMathified
		Head.CFrame = HeadMathifed
	end)
1 Like

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