Is there any way to run a script when a player is looking at a part?

Hello devs.

I’ve got a question about if there’s any way that can run a script when a player looks at a part on the 1st person mode.

Thanks for helping.

Might be a hack but I think you can use proximity prompt with requires line of sight and a high max activation distance.

Then you can use the event:

1 Like

You can have a look at Camera:WorldToViewportPoint(Vector3 world_point) .

Here’s a post that might be helpful: How to tell if a player is looking at a part?

1 Like