So, I’m trying out a little thing that makes your arm follow your mouse, but in each script, body parts addressed from Player.Character are nil. I don’t understand what’s wrong, but Roblox says that the HumanoidRootPart is nil. “Players.AbsurdAwesome101.PlayerScripts.LocalScript:3: attempt to index nil with ‘HumanoidRootPart’” keeps happening. I don’t know if it’s a problem with the script or just an error, but it’s quite frustrating.
This is the script:
local Camera = workspace.Camera
local char = game.Players.LocalPlayer.Character
local HRP = char.HumanoidRootPart
local rightShoulder = char.Torso["Right Shoulder"]
local asin = math.asin
local YOS = rightShoulder.C0.Y
local RunService = game:GetService("RunService")
local CFNew, CFAng = CFrame.new, CFrame.Angles
RunService.RenderStepped:Connect(function()
local Direction = HRP.CFrame:toObjectSpace(Camera.CFrame).lookVector
rightShoulder.C1 = CFNew(0, YOS, 0) * CFAng(3 * math.pi/2, 0, math.pi) * CFAng(0, 0, -asin(Direction.x)) * CFAng(-asin(Direction.y), 0, 0)
end)