Arm following mouse?

INFOMATION:
Everything is handled in a local script.
Arms are welded to the player, the player is invisible
If you like it doesn’t have to be restricted to just LookPartDetector (Info below)
You don’t have to weld the arms they can be Motor6D,etc.
Old character is the player, the parts are welded to old player.

GOAL:
I’m trying to make my “Floaty Boi” (Player) arm follow the mouse but its following not exactly how
I would like it to follow the mouse. (What I wan’t will be provided below)

EXPLORER:
image

WELD INFO:

image

AIMING FOR:

goal

CURRENTLY:

Current

CODE:

local Neck = oldCharacter.Torso.Neck
local Arm = oldCharacter.Torso["Right Shoulder"]
local LookPart = Instance.new("Part")
local LookPartWeld = Instance.new("Weld")
LookPart.Name = "LookPartDetector"
LookPart.Size = Vector3.new(20, 1, 35)
LookPart.Transparency = 0
LookPart.CanCollide = false
LookPart.Parent = character
LookPartWeld.Part0 = LookPart
LookPartWeld.Part1 = oldCharacter.HumanoidRootPart
LookPartWeld.C0 = CFrame.new(0, 5, 20)
LookPartWeld.Parent = LookPart
while true do
	if mouse.Target ~= nil then
		if mouse.Target == LookPart then
			Neck.C1 = CFrame.new(0, 0, 0)
			Neck.C1 = (CFrame.new(oldCharacter.Head.Position, mouse.Hit.p)):toObjectSpace(oldCharacter.Torso.CFrame * Neck.C0);
			Arm.C1 = CFrame.new(0, 0, 0)
			Arm.C1 = (CFrame.new(oldCharacter["Right Arm"].Position, mouse.Hit.p)):toObjectSpace(oldCharacter.Torso.CFrame * Arm.C0 * CFrame.Angles(0, 0, -180) * CFrame.new(0, 1, -0.1));
		end
	end
	wait()
end

CONCLUSION:
So how would I achieve this “Point / Axis” rotation while following the players mouse? Thanks.

1 Like

I made a post that solved a similar issue someone was having not too long ago. I recommend searching the DevForum if anyone has had a similar problem before creating a thread.
Make character’s arm point toward mouse regardless of character rotation

1 Like

I want the arm to move like any normal human arm would. I used your script and modified it for R6
(Here’s my thread)

And the arm rotates itself based on the local Y axis and that’s not how a normal human arm would move when pointing side to side. The local Y axis itself doesn’t move unless you want to turn a knob or something.


I encountered another issue while making the script R6. The arm rotates relative to its original position instead of the shoulder joint. I basically want the arm to rotate its local y axis based on the movement of the mouse.

4 Likes