How to make arm pointing at mouse/arm pointing where camera is looking

  1. What do you want to achieve?
    I want to make arm pointing at mouse (in 3rd person mode) and arm pointing where camera is looking (1rst person mode)

  2. What is the issue? Include screenshots / videos if possible!
    I tried to learn how to use Motor6D but i still don’t know how they work.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Yes I did, however i found script how to make gun aim at mouse but i don’t know how to customize it or how does it work

3 Likes

You can set the rotation part of the CFrame of the arm to:
game.Workspace.CurrentCamera.CFrame.LookVector

It should work on both 3rd and 1st person.

2 Likes

the arm just spins around
also i don’t think im supposed to change arm rotation using rotation (Motor6D is used for rotation etc)

1 Like

Oh. LookVector does work for most things, but something seems to have gone wrong. If you want to use Motor6D then you need to use SetDesiredAngle. Maybe do something like this:
local lookVector = game.Workspace.CurrentCamera.CFrame.LookVector
armMotor.SetDesiredAngle(lookVector.X)

This might work

1 Like

the arm dosent move
30 charrrrr

I don’t know what else could work. However, I found a tutorial on how to do that with the head. You can probably adapt this to be on the arms.

already tried today

local camera = workspace.CurrentCamera
local Character = game.Players.LocalPlayer.Character
local root = Character:WaitForChild("HumanoidRootPart")
local RightShoulder = Character:FindFirstChild("RightUpperArm", true).RightShoulder
local yOffset = RightShoulder.C0.Y

game:GetService("RunService").RenderStepped:Connect(function()
	CameraDirection = root.CFrame:ToObjectSpace(camera.CFrame).lookVector
	
	if RightShoulder then
		RightShoulder.C0 = CFrame.new(0,yOffset,0) * CFrame.Angles(-math.asin(CameraDirection.y ),0,0)
	end
end)

Hello,
i’ve done some research and made this local script

local Player = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local Humanoid = Player:WaitForChild("Humanoid")
local RightShoulder = Player:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder")
local C0 = RightShoulder.C0

game:GetService("RunService").RenderStepped:Connect(function()
	RightShoulder.C0 = C0 * CFrame.new(Vector3.new(), workspace.CurrentCamera.CFrame.LookVector) * CFrame.Angles(math.rad(90),0,0)
end)
2 Likes

However it doesnt works with animations (i think i need to use transform property but idk how does it work)