Yes, I know this is intended behavior, but I have looked pretty far and wide to find a solution to this and have not yet found it, since I would like the head of my character to stay still while swinging the sword (the torso moves). Simply moving it back in the animation is not an option here, since I have it set so that the character’s head faces towards the cursor (I have already tried that route anyways, and it has produced undesirable results). Thanks.
Bumping this since there’s still no response
have you tried animation prioirites?
All of my M1 animations are using Action2 priority (above all of the other animations). None of the animations move the head of the character, just the torso. I’m moving the head using a localscript to make it face towards the player’s cursor, so that doesn’t really require an animation priority.
the head is connected to the torso, sooo thats y it moves w the torso
yes, and I’m asking if there’s a way to make it move independently from the torso
itd prob depend on the script for
youd prob have to show it to see why the head isnt prioritzed over the torso
wait();
local Ang = CFrame.Angles;
local aSin = math.asin;
local aTan = math.atan;
local Cam = game.Workspace.CurrentCamera;
local Plr = game.Players.LocalPlayer;
local Mouse = Plr:GetMouse();
local Body = Plr.Character or Plr.CharacterAdded:wait();
local Head = Body:WaitForChild("Head");
local Hum = Body:WaitForChild("Humanoid");
local Core = Body:WaitForChild("HumanoidRootPart");
local IsR6 = (Hum.RigType.Value==0) ;
local Trso = (IsR6 and Body:WaitForChild("Torso")) or Body:WaitForChild("UpperTorso");
local Neck = (IsR6 and Trso:WaitForChild("Neck")) or Head:WaitForChild("Neck") ;
local Waist = (not IsR6 and Trso:WaitForChild("Waist"));
local LeftShoulder = Body:WaitForChild("LeftUpperArm"):WaitForChild("LeftShoulder");
local RightShoulder = Body:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder");
local MseGuide = true;
local TurnCharacterToMouse = false;
local HeadHorFactor = 1;
local HeadVertFactor = 0.6;
local BodyHorFactor = 0.5;
local BodyVertFactor = 0.4;
local UpdateSpeed = 0.5;
local NeckOrgnC0 = Neck.C0;
local WaistOrgnC0 = (not IsR6 and Waist.C0);
local LeftShoulderOrgnC0 = LeftShoulder.C0;
local RightShoulderOrgnC0 = RightShoulder.C0;
Neck.MaxVelocity = 1/3;
if TurnCharacterToMouse == true then
MseGuide = true;
HeadHorFactor = 0;
BodyHorFactor = 0;
end
game:GetService("RunService").RenderStepped:Connect(function()
local CamCF = Cam.CoordinateFrame;
if ((IsR6 and Body["Torso"]) or Body["UpperTorso"])~=nil and Body["Head"]~=nil then --\[Check for the Torso and Head...\]
local TrsoLV = Trso.CFrame.lookVector;
local HeadLV = Head.CFrame.lookVector;
local HdPos = Head.CFrame.p;
local LeftShoulderPos = Body:WaitForChild("LeftUpperArm").CFrame.p;
local RightShoulderPos = Body:WaitForChild("RightUpperArm").CFrame.p;
if IsR6 and Neck or Neck and Waist then
if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then
local Dist = nil;
local Diff = nil;
if not MseGuide then
Dist = (Head.CFrame.p-CamCF.p).magnitude
Diff = Head.CFrame.Y-CamCF.Y
local DiffLS = Body:WaitForChild("LeftUpperArm").CFrame.Y-CamCF.Y
local DiffRS = Body:WaitForChild("RightUpperArm").CFrame.Y-CamCF.Y
if not IsR6 then
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aSin(Diff/Dist)*HeadVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2);
Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang((aSin(Diff/Dist)*BodyVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2);
LeftShoulder.C0 = LeftShoulder.C0:lerp(LeftShoulderOrgnC0.C0*Ang((aSin(DiffLS/Dist)*0.5), -(((LeftShoulderPos-CamCF.p).Unit):Cross(HeadLV)).Y*0.6, 0), UpdateSpeed/2);
RightShoulder.C0 = RightShoulder.C0:lerp(RightShoulderOrgnC0.C0*Ang((aSin(DiffRS/Dist)*0.5), -(((RightShoulderPos-CamCF.p).Unit):Cross(HeadLV)).Y*0.6, 0), UpdateSpeed/2);
else
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aSin(Diff/Dist)*HeadVertFactor), 0, -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor),UpdateSpeed/2);
end;
else
local Point = Mouse.Hit.p;
Dist = (Head.CFrame.p-Point).magnitude;
Diff = Head.CFrame.Y-Point.Y;
local DistLS = (Body:WaitForChild("LeftUpperArm").CFrame.p-Point).magnitude;
local DistRS = (Body:WaitForChild("RightUpperArm").CFrame.p-Point).magnitude;
local DiffLS = Body:WaitForChild("LeftUpperArm").CFrame.Y-CamCF.Y;
local DiffRS = Body:WaitForChild("RightUpperArm").CFrame.Y-CamCF.Y;
if not IsR6 then
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aTan(Diff/Dist)*HeadVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2);
Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang(-(aTan(Diff/Dist)*BodyVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2);
else
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aTan(Diff/Dist)*HeadVertFactor), 0, (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor), UpdateSpeed/2);
end;
end;
end;
end;
end;
if TurnCharacterToMouse == true then
Hum.AutoRotate = false;
Core.CFrame = Core.CFrame:lerp(CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)), UpdateSpeed / 2);
else
Hum.AutoRotate = true;
end;
end);