I’ve never touched Raycast before then ive come across about raycasting so i thought something like shooting and i need to know if the player saw the enemy by running a raycast at the camera like it was a game where they will predict where to shoot so i tried playing with it and still cannot understand how it works. I tried this code to see if the raycast would hit the player and will return true that its seen
workspace:Raycast(workspace.Enemy.Head.Position,(workspace.Camera.CFrame.p - workspace.Enemy.Head.Position).Unit * 500) --sometimes returns nil
Goal in summary: Raycast the camera to the enemy’s head and know if the raycast hits the head, if it did, return true.