Help fixing ViewModel

Hey!

By following a tutorial, I made a ViewModel that shows the player arms once he starts running. The problem is that it is a bit buggy. Depending the angle you look, one of the arms disappears or becomes barely visible.

By removing the CameraOffset you can see the mess that is happening:

Here’s the script:

-- in StarterCharacterScripts
local RS = game:GetService("RunService")
local VM = game:GetService("ReplicatedStorage"):WaitForChild("Game_Stuff"):WaitForChild("ViewModel")
local Char = script.Parent

VM.Parent = workspace.CurrentCamera
local lArm = Char.LeftUpperArm.LeftShoulder
local rArm = Char.RightUpperArm.RightShoulder

RS.RenderStepped:Connect(function()
	VM:PivotTo(workspace.CurrentCamera.CFrame)
	local dist = (workspace.CurrentCamera.CFrame.Position - Char.Head.Position).Magnitude
	if dist < 1 then
		lArm.Part0 = VM.UpperTorso
		rArm.Part0 = VM.UpperTorso
	else
		lArm.Part0 = Char.HumanoidRootPart
		rArm.Part0 = Char.HumanoidRootPart
	end
end)

ViewModel:
image

Thank you for your attention!

EasyFirstPerson by @yelowfat seems to have the same problem…

It was a animation overlap problem. Found out after one week trying to work around that :slight_smile:

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