R15: make arms rotate up and down relative to the mouse

  1. What do you want to achieve? Keep it simple and clear!
    I’m making a 3rd person gun system. I got a problem while i was testing if the camera works propertly. I noticed the arms weren’t moving up and down relative to the camera movement. How can i fix this issue?

  2. What is the issue? Include screenshots / videos if possible!
    I just can’t figure out how to manipulate the shoulder joint CFrame in a way, so the characters arms rotate up and down while pointing at the mouse.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I read multiple posts about the arms following the cursor, but they were either for R6 or just wouldn’t work like I wanted.

here is a snip of what i mean:
grafik

Any help is appreciated! :slight_smile:

3 Likes

Here’s a snippet from one of my older games. This rotates the arms along with the head.

local runService = game:GetService("RunService")
local camera = game.Workspace.Camera
local remoteEvent = game.ReplicatedStorage:WaitForChild("ArmRotation") --This is just used to replicate the movements to the server

local character = script.Parent
local player = game.Players.LocalPlayer
local leftMotor6 = character:WaitForChild("LeftUpperArm"):WaitForChild("LeftShoulder")
local rightMotor6 = character:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder")
local headMotor6 = character:WaitForChild("Head"):WaitForChild("Neck")

runService.RenderStepped:Connect(function()
	leftMotor6.C0 = CFrame.new(leftMotor6.C0.Position) * CFrame.Angles(camera.CFrame.LookVector.Y, 0, 0)
	rightMotor6.C0 = CFrame.new(rightMotor6.C0.Position) * CFrame.Angles(camera.CFrame.LookVector.Y, 0, 0)
	headMotor6.C0 = CFrame.new(headMotor6.C0.Position) * CFrame.Angles(camera.CFrame.LookVector.Y, 0, 0)
	remoteEvent:FireServer(character, camera.CFrame.LookVector.Y) --Same explanation
end)
5 Likes

That works fine, thank you very much :smiley:

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