As you can see in this video, my character tilting doesn’t work properly:
and my character tilting script is here
local neckC0 = CFrame.new(0, 1.173, -0.009, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local waistC0 = CFrame.new(0, 0.109, -0.009, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local lShoulderC0 = CFrame.new(-0.812, 0.69, -0.009, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local rShoulderC0 = CFrame.new(0.812, 0.69, -0.009, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local ToolOffset = CFrame.new(0, 0.634, 0);
function Tilt(character: Model, theta: number)
if not character then
return
end
if not (character:FindFirstChildOfClass("Humanoid") and character.Humanoid.Health > 0 and character:FindFirstChild("Head")) then
return
end
local neck = character.Head.Neck
local waist = character.UpperTorso.Waist
local rShoulder = character.RightUpperArm.RightShoulder
local lShoulder = character.LeftUpperArm.LeftShoulder
task.synchronize()
neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(theta*.75, 0, 0);
waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(theta*0.25, 0, 0);
rShoulder.C0 = rShoulderC0 * CFrame.fromEulerAnglesYXZ(theta*0.75, 0, 0);
lShoulder.C0 = lShoulderC0 * CFrame.fromEulerAnglesYXZ(theta*0.75, 0, 0);
end
return Tilt
(each client fires the remoteEvent to server)
I think the torso rotated in the gun animation caused this problem
Help me!