I am trying to make the player's right arm point where the camera is looking but I keep getting the error saying "attempt to index nil with 'C0' " Here is the script:
local cam = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local RightArm = char:FindFirstChild("RightArm", true)
local y = RightArm.C0.Y
game:GetService("RunService").RenderStepped:Connect(function()
if RightArm then
local camDirection = hrp.CFrame:ToObjectSpace(cam.CFrame).LookVector
RightArm.C0 = CFrame.new(0,y,0) * CFrame.Angles(0, -camDirection.X, 0) * CFrame.Angles(camDirection.Y,0,0)
end
end)

2 comments
that cleared the error but now it's just an infinite yield. Is the right arm not defined maybe?
I just checked that the character doesn't have a right arm. It has a RightLowerArm and RightUpperArm though so you can use one of those.