local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local remote = ReplicatedStorage:WaitForChild(“Look”)
remote.OnServerEvent:Connect(function(player, lookVector)
local character = player.Character
if not character then return end
local torso = character:FindFirstChild("Torso")
if not torso then return end
local neck = torso:FindFirstChild("Neck")
if not neck then return end
-- Apply for everyone
--neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin(lookVector.Y), 0, 0)
--neck.C1 = CFrame.new()
--R6 Only
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage:WaitForChild("Look")
local camera = workspace.CurrentCamera
local character = script.Parent
local torso = character:WaitForChild("Torso")
local head = character:WaitForChild("Head")
local rightShoulder = torso:WaitForChild("Right Shoulder")
local leftShoulder = torso:WaitForChild("Left Shoulder")
local neck = torso:WaitForChild("Neck")
local rightShoulderCopy = Instance.new("Motor6D")
rightShoulderCopy.C0 = CFrame.new(1.5, -1, 0) * rightShoulder.C0.Rotation
rightShoulderCopy.C1 = CFrame.new(0, .5, 0) * rightShoulder.C1.Rotation
rightShoulderCopy.Part1 = rightShoulder.Part1
rightShoulderCopy.Name = "RightShoulderCopy"
rightShoulderCopy.Archivable = false
rightShoulderCopy.Part0 = head
rightShoulderCopy.Parent = head
local leftShoulderCopy = Instance.new("Motor6D")
leftShoulderCopy.C0 = CFrame.new(-1.5, -1, 0) * leftShoulder.C0.Rotation
leftShoulderCopy.C1 = CFrame.new(0, .5, 0) * leftShoulder.C1.Rotation
leftShoulderCopy.Part1 = leftShoulder.Part1
leftShoulderCopy.Name = "LeftShoulderCopy"
leftShoulderCopy.Archivable = false
leftShoulderCopy.Part0 = head
leftShoulderCopy.Parent = head
rightShoulder.Enabled = false
leftShoulder.Enabled = false
RunService.RenderStepped:Connect(function()
local lookVector = (camera.Focus.Position - camera.CFrame.Position).Unit
neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin(lookVector.Y), 0, 0)
neck.C1 = CFrame.new()
remote:FireServer(lookVector)
end)
RunService.Stepped:Connect(function()
rightShoulderCopy.Transform = rightShoulder.Transform
leftShoulderCopy.Transform = leftShoulder.Transform
end)
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
local _camera = workspace.CurrentCamera
if _camera then
camera = _camera
end
end)
serverscript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage:WaitForChild("Look")
remote.OnServerEvent:Connect(function(player, lookVector)
local character = player.Character
if not character then return end
local torso = character:FindFirstChild("Torso")
if not torso then return end
local neck = torso:FindFirstChild("Neck")
if not neck then return end
-- Apply for everyone
neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin(lookVector.Y), 0, 0)
neck.C1 = CFrame.new()
end)
I think the arms move as a result of the Gun that you equipped in the first video, not the local script provided? I think it’s tied to your Neck C0, C1.
Can you provided the script for the gun? It may be a case of making a Pseudo value to mimic to C0 without changing the neck.
The only thing I can think is that your free models are contradicting eachother.
So your LocalScript disables the joints in the character so that false joints can be used - But then when equipping the gun this function doesn’t work anymore.
Basically I think the server side of the gun is contradicting the client side of the script provided.
--R6 Only
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remote = ReplicatedStorage:WaitForChild("Look")
local camera = workspace.CurrentCamera
local character = script.Parent
local torso = character:WaitForChild("Torso")
local head = character:WaitForChild("Head")
local rightShoulder = torso:WaitForChild("Right Shoulder")
local leftShoulder = torso:WaitForChild("Left Shoulder")
local rightShoulderOriginalC0 = rightShoulder.C0
local leftShoulderOriginalC0 = leftShoulder.C0
RunService.RenderStepped:Connect(function()
local origin = torso.CFrame
local headFromOrigin = head.CFrame * origin:Inverse()
local lookVector = (camera.Focus.Position - camera.CFrame.Position).Unit
local angle = CFrame.Angles(math.asin(lookVector.Y), 0, 0)
local headToRightArm = (headFromOrigin:Inverse() * rightShoulderOriginalC0)
rightShoulder.C0 = headFromOrigin * angle * headToRightArm
local headToLeftArm = (headFromOrigin:Inverse() * leftShoulderOriginalC0)
leftShoulder.C0 = headFromOrigin * angle * headToLeftArm
remote:FireServer(lookVector)
end)
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
local _camera = workspace.CurrentCamera
if _camera then
camera = _camera
end
end)
Now the arms should move without the head moving.
I won’t go through explaining how it works right now since it’s a lot to write, but if you want me to (and this solves your problem), I can.