Issue with Script - Unable to Locate Right Arm

Hello everyone,

I’m encountering an issue with a script in my Roblox game, and I’m seeking help to resolve it. I have a script that is supposed to make the player’s right arm follow the cursor, but I’m consistently getting an error that says “Right Arm not found in character.” I’ve checked my script, and it seems fine to me, but I can’t figure out what’s causing this problem.

Here’s the relevant part of my script:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local character = player.Character or player.CharacterAdded:Wait()
local rightArm = character:WaitForChild("Right Arm", 5)

if rightArm then
    mouse.Move:Connect(function()
        local targetPosition = mouse.Hit.p
        local direction = (targetPosition - rightArm.Position).Unit
        rightArm.CFrame = CFrame.new(rightArm.Position, targetPosition) * CFrame.Angles(math.pi/2, 0, 0)
    end)
else
	error("Error: 'Right Arm' not found in character.")
end

I’ve double-checked that “Right Arm” is correctly spelled in the script and that the arm is a part of the character hierarchy. I’ve also tried using the CharacterAdded event to ensure the character is fully loaded before running the script, but the error still persists.

Any insights or suggestions on what might be causing this issue and how to resolve it would be greatly appreciated. If you have any advice or guidance, please let me know. Thank you in advance for your help.

1 Like

Hi,

I have just ran this exact subset of code in my own baseplate game, and the error doesn’t happen for me
Are you sure your character is R6? Where is this script located in the game?

I have a RightLowerArm and RightUpperArm, not sure if you do too

That’s because you have an r15 avatar. The ‘Right Arm’ is R6 only

1 Like

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