I’m trying to make a horror game and I want to detect if the player can see the monster. How would I do this? Any help would be very appreciated!
COMMUNITY QUESTION
How would I detect if the player can see an object?
1 answer
It's possible. I already made the script because I wanted to know how to do this and someone had a similar Question.
Research WorldToScreenPoint() and GetPartsObscuringTarget()
WorldToScreenPoint() -- This can tell you if a Part is visible(even through walls)
GetPartsObscuringTarget() -- This gives you a Table containing all the parts that is intersecting two given points
If you do it right then you can detect if the monster is in the player's screen. Unless if you want to know if the player is looking directly at the monster then use RayCasting or mouse.Target
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
One way is, RAYCASTING!!!
@BashGuy10, can you explain how to do raycasting in an answer?
Try raycasting, it really helps. I don't know much about raycasting but search some up, i'll make some if you can't find the right tutorial!