I've been testing my AI for a thief game. If he spots you, he'll look at you to investigate. But the AI's head doesn't move. How do I fix this??
My Code:
function lookAt(player)
local is_in_front = NPC.PrimaryPart.CFrame:ToObjectSpace(player.Character.PrimaryPart.CFrame).Z < 0
if is_in_front then
NPC.Head.CFrame = CFrame.new(NPC.Head.CFrame.p,(NPC.Head.CFrame.p - player.Character.Head.CFrame.p).Unit)
end
end
