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)
You should use :WaitForChild instead of :FindFirstChild
local RightArm = char:WaitForChild("RightArm")