Hello! As you can see in the title and the video above, the gun and the arm are not aligned properly. when I look up (or down), the gun overlaps the hand weirdly.
I have no idea. how can I solve this?
local neckC0 = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local waistC0 = CFrame.new(0, 0.2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local rShoulderC0 = CFrame.new(0.712, 0.634, -0.008, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local lShoulderC0 = CFrame.new(-0.712, 0.634, -0.008, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local rShoulderC1 = CFrame.new(0.296, 0.409, -0.01, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local lShoulderC1 = CFrame.new(-0.296, 0.409, -0.01, 1, 0, 0, 0, 1, 0, 0, 0, 1);
game:GetService("ReplicatedStorage").tiltAt.OnServerEvent:Connect(function(player, theta)
if not player.Character.Head:FindFirstChild("Neck") then return end
local neck = player.Character.Head.Neck
local waist = player.Character.UpperTorso.Waist
local rShoulder = player.Character.RightUpperArm.RightShoulder
local lShoulder = player.Character.LeftUpperArm.LeftShoulder
neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(theta*.75, 0, 0);
waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(theta*.25, 0, 0);
rShoulder.C0 = rShoulderC0 * CFrame.fromEulerAnglesYXZ(theta*.75, 0, 0);
lShoulder.C0 = lShoulderC0 * CFrame.fromEulerAnglesYXZ(theta*.75, 0, 0);
end)
^
This is server side character tilting script.
Players send tilt angles to the server every frame.(I referenced this tutorial)
The gun is connected to the head by motor6d. Maybe that’s why it doesn’t seem to work properly.
Please help!!