I will refer to my part as TargetPart
(TargetPart
is not a player, it is just a regular part)
What do I want to accomplish?
If my TargetPart
is being looked at by ANY players face in the game AND
if any players are visible from my TargetPart
then print("Ready")
If a player is looking at a wall but the TargetPart
so happends to be behind that wall, I do NOT
want it to count as it being looked at.
For the part where the TargetPart
finds if it can see a player, I want it to act as if it is sending out millions of small raycasts to see if one of the raycasts hits a player(When I say millions of raycast, I dont mean just in one direction, I want it to go out from every direction from the TargetPart
, to see if it hits a player.
Problem:
The problem is… I don’t know how to do this lol. I have seen many ways people do it between, viewports, and raycasting, but I haven’t seen a combination of bothing seeing if the TargetPart
is visible and if the TargetPart
can see a player.