How can I check if an object is on the players screen

I wanna check if a certain object is on the players screen through a serverscript which then if the player is not looking then the certain function inside of the script will run, I know how to do this through a local script but I wanna do this from a server script because this should also work with multiple players for example:

2 players are looking at a brick, if 1 person looks away the brick wont do anything. Once the both players turn their cameras, not character away the brick will turn Pink, once both players or 1 player turns back the brick turns back white.

Any help is appreciated.

2 Likes

You should send it with a Remote event/function depending on if you want the client to have input returned from the server. They are very helpful for client side to server side communication. So you can check locally for the looking at, and if the looking at stops, send a remote vent to the server. Saying the player stopped looking. Once both players are not looking at the same time, you can have it turn a different color

1 Like

Can you provide an example as a constant loop? Or something close to that

1 Like

This will actually be better for you. My method would be too remote intensive. I didn’t really think about the process. Thankfully someone already asked this question. How would I detect if the player can see an object? - #3 by T0ny

2 Likes

And this was the agreed upon solution. Camera | Documentation - Roblox Creator Hub

1 Like