How to detect if a part is in player camera view?

Hey Developers!
I got a question.
Let’s say we have a red part in the workspace.
How to detect that if the player is staring at the part?
I wanted to make it like whenever a player looks at that part it decrease the player’s health.
Even a small tip is appreciated!
Thanks for reading!

You can do this with worldtoscreenpoint I believe. Camera:WorldToScreenPoint you can read about it here.

local _, inScreen = Camera:WorldToScreenPoint(thing.Position)

^ is how you would do it as a starter.

1 Like

Thanks! I’ll mark this as Solution! It helped a lot!