I saw a post about this but in R6, I tried replicating it in r15, but now the head doesnt turn in the right direction at all. Any help with this?
local rs = game:GetService("RunService")
local ps = game:GetService("Players")
local player = ps.LocalPlayer
local mouse = player:GetMouse()
local rig = workspace.IntroNPCs:WaitForChild("GirlRig")
local humanoid = rig:FindFirstChildOfClass("Humanoid")
local head = rig:FindFirstChild("Head")
local torso = rig:FindFirstChild("UpperTorso")
local rig2 = workspace.IntroNPCs:WaitForChild("BoyRig")
local humanoid2 = rig2:FindFirstChildOfClass("Humanoid")
local head2 = rig2:FindFirstChild("Head")
local torso2 = rig2:FindFirstChild("UpperTorso")
if humanoid and head and torso and humanoid2 and head2 and torso2 then
local neck = head:FindFirstChild("Neck")
local NeckOriginC0 = neck.C0
local neck2 = head2:FindFirstChild("Neck")
local NeckOriginC02 = neck2.C0
rs.RenderStepped:Connect(function()
local position = Camera.CFrame.Position - Vector3.new(0,1,0) + Camera:ViewportPointToRay(mouse.X, mouse.Y).Direction*14
local TranslationVector = (head.Position - position).Unit
local Pitch = math.atan(TranslationVector.Y)
local Yaw = TranslationVector:Cross(head.CFrame.LookVector).Y
local NeckCFrame = CFrame.Angles(Pitch, 0, Yaw)
neck.C0 = neck.C0:Lerp(NeckOriginC0 * NeckCFrame, 0.15)
--------
local position2 = Camera.CFrame.Position - Vector3.new(0,1,0) + Camera:ViewportPointToRay(mouse.X, mouse.Y).Direction*14
local TranslationVector2 = (head2.Position - position2).Unit
local Pitch2 = math.atan(TranslationVector2.Y)
local Yaw2 = TranslationVector2:Cross(head2.CFrame.LookVector).Y
local NeckCFrame2 = CFrame.Angles(Pitch2, 0, Yaw2)
neck2.C0 = neck2.C0:Lerp(NeckOriginC02 * NeckCFrame2, 0.15)
end)
end