For some reason lookAt starts pulling the player to the NPC instead of the player just looking at the NPC
This happens when the player is playing an animation
function Combat:lookAt(Target : Model)
local char = player.Character
if not char then
return
end
if not self.Connections['lookAt'] then
self.Connections['lookAt'] = RunService.Heartbeat:Connect(function(deltaTime: number)
local charPos = char:GetPivot().Position
local TargetPos = Target:GetPivot().Position
char:PivotTo(CFrame.lookAt(charPos, Vector3.new(TargetPos.X,charPos.Y,TargetPos.Z)))
end)
end
end