local Guard = script.Parent
local GuardRoot = Guard:WaitForChild("HumanoidRootPart")
local GuardHumanoid = Guard:WaitForChild("Humanoid")
local Player = game.Workspace:WaitForChild("SneakySecretAgent")
local PlayerRoot = Player:WaitForChild("HumanoidRootPart")
while true do
wait()
local PlayerPosition = PlayerRoot.Position
local GuardFace = GuardRoot.CFrame.lookVector
local PlayerFromGuard = PlayerPosition - GuardPosition
local Product = GuardFace:Dot(PlayerFromGuard)
local Cos = math.cos(Product)
local Angle = math.acos(Cos)
end
Basically the dot product part works well (hopefully), as I'm trying to see if the a guard can see the player, which in turn means I need to use the dot product to check how much the guard is facing the player.
Problem is, I want to reduce the sight of the guard, but I need to get the angle using the dot product. My script doesn't seem to input the correct angle.
Thanks in advance

1 comment
Hey man! Thanks for your own interpretation of that guide. I seem to have screwed it right there. hehe