local part = script.Parent
part.Touched:Connect(function(hit)
local view = hit.Parent:FindFirstChild("Union")
if view then
script.Parent.Anchored = true
print("Player see")
else
print("player unsee")
script.Parent.Anchored = false
end
end)
i am scripting SCP 173 and in the output only "Player see" repeat while "Player unsee" works only when spawning

1 comment
You'll need to do math and use CFrame to see if the player is looking away. I suggest looking at DotProduct to see a player's 'field of view'. https://www.youtube.com/watch?v=BUwAcW_18Ws