What is the best way to create fake FPS hands?

Like 2 years ago I made a modified version of a nasty code thing that I found. The code used :Lerp to move the player’s arms along with the camera. The code is messed up but maybe you can revamp it.

local player = game.Players.LocalPlayer
local character = player.Character

if not character or not character.Parent then
	character = player.CharacterAdded:Wait()
end

local torso = character:WaitForChild("Torso")
local rightShoulder = torso:WaitForChild("Right Shoulder")
local leftShoulder = torso:WaitForChild("Left Shoulder")
local camera = game.Workspace.CurrentCamera

local UserInput = game:GetService("UserInputService")

local updateSpeed = .25

game:GetService("RunService").RenderStepped:Connect(function()
	character["Right Arm"].LocalTransparencyModifier = character["Right Arm"].Transparency 
	character["Left Arm"].LocalTransparencyModifier = character["Left Arm"].Transparency
	character["Right Leg"].LocalTransparencyModifier = character["Right Leg"].Transparency
	character["Left Leg"].LocalTransparencyModifier = character["Left Leg"].Transparency
	character.Torso.LocalTransparencyModifier = 0
	local distance = (character.Head.Position - camera.CoordinateFrame.p).magnitude
	if distance <= 1 then
		character.Humanoid.CameraOffset = Vector3.new(0, 0, -.75)
		
		rightShoulder.C0 = rightShoulder.C0:lerp((camera.CoordinateFrame * CFrame.new(1, -1.25, -.25)):toObjectSpace(torso.CFrame):inverse() * CFrame.Angles(0, math.pi/2, 0), updateSpeed)
		leftShoulder.C0 = leftShoulder.C0:lerp((camera.CoordinateFrame * CFrame.new(-0.2, -1.5, -.6)):toObjectSpace(torso.CFrame):inverse() * CFrame.Angles(0, math.pi/.65, 0), updateSpeed)
	else
		rightShoulder.C0 = rightShoulder.C0:lerp(CFrame.new(1, 0.5, 0) * CFrame.Angles(0, math.pi/2, 0),updateSpeed)
		leftShoulder.C0 = leftShoulder.C0:lerp(CFrame.new(-1, 0.5, 0) * CFrame.Angles(0, -math.pi/2, 0),updateSpeed)
	end	
end)


4 Likes